? .DS_Store ? diff ? AppleBMacEthernet.pbproj/local.mode1 Index: BMacEnet.cpp =================================================================== RCS file: /cvs/root/IO/Drivers/Ethernet/AppleBMacEthernet/BMacEnet.cpp,v retrieving revision 1.7 diff -u -d -b -w -r1.7 BMacEnet.cpp --- BMacEnet.cpp 2003/11/21 18:06:53 1.7 +++ BMacEnet.cpp 2004/10/15 20:25:01 @@ -278,7 +278,6 @@ { IOLog( "BMacEnet::start: Couldn't allocate KDB buffer\n" ); return false; } - txDebuggerPkt->m_next = 0; #if 0 // Enable the interrupt event sources. The hardware interrupts @@ -497,7 +496,7 @@ * *-------------------------------------------------------------------------*/ -UInt32 BMacEnet::outputPacket(struct mbuf * pkt, void * param) +UInt32 BMacEnet::outputPacket( mbuf_t pkt, void *param ) { u_int32_t i; UInt32 ret = kIOReturnOutputSuccess; Index: BMacEnet.h =================================================================== RCS file: /cvs/root/IO/Drivers/Ethernet/AppleBMacEthernet/BMacEnet.h,v retrieving revision 1.6 diff -u -d -b -w -r1.6 BMacEnet.h --- BMacEnet.h 2003/11/21 18:06:53 1.6 +++ BMacEnet.h 2004/10/15 20:25:01 @@ -33,17 +33,21 @@ #ifndef _BMACENET_H #define _BMACENET_H +#define __MBUF_TRANSITION_ + #include #include #include #include #include +#include #include #include #include #include /* bcopy */ #include "BMacEnetRegisters.h" + extern "C" { #include #include @@ -113,9 +117,9 @@ OSDictionary * mediumDict; - struct mbuf * txMbuf[TX_RING_LENGTH]; - struct mbuf * rxMbuf[RX_RING_LENGTH]; - struct mbuf * txDebuggerPkt; + mbuf_t txMbuf[ TX_RING_LENGTH ]; + mbuf_t rxMbuf[ RX_RING_LENGTH ]; + mbuf_t txDebuggerPkt; unsigned int txCommandHead; // TX ring descriptor index unsigned int txCommandTail; @@ -127,7 +131,7 @@ UInt8* dmaCommands; UInt32 dmaCommandsPhys; UInt32 dmaCommandsSize; - IOMemoryDescriptor* dmaCommandsDesc; + IOBufferMemoryDescriptor* dmaCommandsDesc; enet_txdma_cmd_t * txDMACommands; // TX descriptor ring ptr unsigned int txDMACommandsPhys; @@ -156,17 +160,16 @@ void _enableAdapterInterrupts(); void _setDuplexMode(bool duplexMode); void _startChip(); - bool _updateDescriptorFromMbuf(struct mbuf * m, enet_dma_cmd_t * desc, - bool isReceive); + bool _updateDescriptorFromMbuf( mbuf_t m, enet_dma_cmd_t *desc, bool isReceive ); void _restartTransmitter(); void _stopTransmitDMA(); - bool _transmitPacket(struct mbuf * packet); + bool _transmitPacket( mbuf_t packet ); bool _transmitInterruptOccurred(); bool _debugTransmitInterruptOccurred(); bool _receiveInterruptOccurred(); bool _rejectBadUnicastPacket(struct ether_header * etherHeader); bool _receivePackets(bool fDebugger); - void _packetToDebugger(struct mbuf * packet, u_int size); + void _packetToDebugger( mbuf_t packet, u_int size ); void _restartReceiver(); void _stopReceiveDMA(); bool _resetAndEnable( bool enable ); @@ -206,7 +209,7 @@ bool miiFindPHY(unsigned char * phy_num); bool miiInitializePHY(unsigned char phy); - UInt32 outputPacket(struct mbuf * m, void * param); + UInt32 outputPacket( mbuf_t m, void *param ); static void interruptOccurred( OSObject *me, IOInterruptEventSource *src, int count ); static void timerPopped( OSObject *me, IOTimerEventSource* timer ); Index: BMacEnetPrivate.cpp =================================================================== RCS file: /cvs/root/IO/Drivers/Ethernet/AppleBMacEthernet/BMacEnetPrivate.cpp,v retrieving revision 1.6 diff -u -d -b -w -r1.6 BMacEnetPrivate.cpp --- BMacEnetPrivate.cpp 2003/11/21 18:06:53 1.6 +++ BMacEnetPrivate.cpp 2004/10/15 20:25:03 @@ -83,9 +83,6 @@ bool BMacEnet::_allocateMemory() { - IOReturn ior; - - /* Calculate total space for DMA channel commands: */ dmaCommandsSize = round_page( @@ -93,25 +90,24 @@ + TX_RING_LENGTH * sizeof (enet_txdma_cmd_t ) + 2 * sizeof( IODBDMADescriptor ) ); - dmaCommands = (UInt8*)IOMallocContiguous( dmaCommandsSize, PAGE_SIZE, 0 ); + dmaCommandsDesc = IOBufferMemoryDescriptor::withOptions( kIOMemoryPhysicallyContiguous, + dmaCommandsSize, + PAGE_SIZE ); - if ( dmaCommands == NULL ) + if ( dmaCommandsDesc == NULL ) { IOLog( "BMacEnet::_allocateMemory: Cannot allocate channel DBDMA commands\n" ); return false; } + dmaCommandsDesc->prepare( kIODirectionOutIn ); - dmaCommandsDesc = IOMemoryDescriptor::withAddress( (vm_address_t)dmaCommands, - dmaCommandsSize, - kIODirectionOutIn, - kernel_task ); - dmaCommandsPhys = dmaCommandsDesc->getPhysicalAddress(); + dmaCommands = (UInt8*)dmaCommandsDesc->getBytesNoCopy(); // get virtual address + dmaCommandsPhys = dmaCommandsDesc->getPhysicalAddress(); // may be DART address if ( dmaCommandsPhys == 0 ) { IOLog( "BMacEnet::_allocateMemory - Cannot get DBDMA commands physical address.\n" ); return false; } - ior = dmaCommandsDesc->prepare( kIODirectionOutIn ); /* * Setup the receive ring pointers @@ -707,7 +703,7 @@ * *-------------------------------------------------------------------------*/ -bool BMacEnet::_transmitPacket(struct mbuf *packet) +bool BMacEnet::_transmitPacket( mbuf_t packet ) { enet_dma_cmd_t tmpCommand; u_int32_t i; @@ -725,8 +721,7 @@ i = txCommandTail + 1; if ( i >= txMaxCommand ) i = 0; - if ( (i == txCommandHead) || - !_updateDescriptorFromMbuf(packet, &tmpCommand, false) ) + if ( (i == txCommandHead) || !_updateDescriptorFromMbuf( packet, &tmpCommand, false ) ) { IOLog( "BMacEnet::_transmitPacket: Freeing transmit packet eh?\n" ); if (packet != txDebuggerPkt) @@ -811,11 +806,13 @@ * It also sets the var debuggerPktSize which will break the polling loop. *-------------------------------------------------------------------------*/ -void BMacEnet::_packetToDebugger(struct mbuf * packet, u_int size) +void BMacEnet::_packetToDebugger( mbuf_t packet, u_int size ) { debuggerPktSize = size; - bcopy( mtod(packet, char *), debuggerPkt, size ); -} + bcopy( (char*)mbuf_data( packet ), debuggerPkt, size ); + return; +}/* end _packetToDebugger */ + /*------------------------------------------------------------------------- * _sendPacket @@ -849,14 +846,15 @@ if ( txCommandHead != txCommandTail ) { - IOLog( "BMacEnet::_sendPacket: Polled tranmit timeout - 1\n" ); + IOLog( "BMacEnet::_sendPacket: Polled transmit timeout - 1\n" ); return; } /* Recycle the same buffer dedicated to KDB transmit. */ - bcopy( pkt, txDebuggerPkt->m_data, pkt_len ); - txDebuggerPkt->m_pkthdr.len = txDebuggerPkt->m_len = pkt_len; + bcopy( pkt, (char*)mbuf_data( txDebuggerPkt ), pkt_len ); + mbuf_setlen( txDebuggerPkt, pkt_len ); + mbuf_pkthdr_setlen( txDebuggerPkt, pkt_len ); /* * Send the debugger packet. txDebuggerPkt must not be freed by @@ -878,7 +876,7 @@ if ( txCommandHead != txCommandTail ) { - IOLog( "BMacEnet::_sendPacket: Polled tranmit timeout - 2\n" ); + IOLog( "BMacEnet::_sendPacket: Polled transmit timeout - 2\n" ); } return; @@ -955,9 +953,9 @@ bool BMacEnet::_receivePackets(bool fDebugger) { enet_dma_cmd_t tmpCommand; - struct mbuf * packet; + mbuf_t packet; u_int32_t i, j, last; - int receivedFrameSize = 0; + long unsigned int receivedFrameSize = 0; u_int32_t dmaCount[2], dmaResid[2], dmaStatus[2]; u_int32_t dmaChnlStatus; u_int16_t rxPktStatus = 0; @@ -1017,8 +1015,7 @@ /* * Get the receive frame size as reported by the BMac controller */ - rxPktStatus = *(u_int16_t *)(mtod(rxMbuf[i], u_int32_t) + - receivedFrameSize - 2); + rxPktStatus = *(u_int16_t*)((char*)mbuf_data( rxMbuf[i] ) + receivedFrameSize - 2); receivedFrameSize = rxPktStatus & kRxLengthMask; } @@ -1028,7 +1025,7 @@ if ( receivedFrameSize < (kIOEthernetMinPacketSize - kIOEthernetCRCSize) || receivedFrameSize > (kIOEthernetMaxPacketSize) || rxPktStatus & kRxAbortBit || - _rejectBadUnicastPacket(mtod(rxMbuf[i], struct ether_header *)) + _rejectBadUnicastPacket( (struct ether_header*)mbuf_data( rxMbuf[i] ) ) ) { if (useNetif) netStats->inputErrors++; @@ -1420,20 +1417,17 @@ * *-------------------------------------------------------------------------*/ -bool -BMacEnet::_updateDescriptorFromMbuf(struct mbuf * m, enet_dma_cmd_t *desc, - bool isReceive) +bool BMacEnet::_updateDescriptorFromMbuf( mbuf_t m, enet_dma_cmd_t *desc, bool isReceive ) { u_int32_t nextDesc = 0; u_int32_t waitMask = 0; - int segments; + UInt32 segments; struct IOPhysicalSegment segVector[2]; segments = mbufCursor->getPhysicalSegmentsWithCoalesce(m, segVector); if ((!segments) || (segments > 2)) { - IOLog( "BMac:_updateDescriptorFromMbuf error, %d segments\n", - segments); + IOLog( "BMac:_updateDescriptorFromMbuf error, %d segments\n", (int)segments ); return false; } Index: AppleBMacEthernet.pbproj/project.pbxproj =================================================================== RCS file: /cvs/root/IO/Drivers/Ethernet/AppleBMacEthernet/AppleBMacEthernet.pbproj/project.pbxproj,v retrieving revision 1.11 diff -u -d -b -w -r1.11 project.pbxproj --- project.pbxproj 2003/11/21 19:19:03 1.11 +++ project.pbxproj 2004/10/15 20:25:03 @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 38; + objectVersion = 39; objects = { 01833DA1FFD2F31611CA2B4D = { fileRef = 020A3990FFB0FA9711CA2B4D; @@ -12,25 +12,30 @@ }; }; 01EE1BD3FFC9F1AA11CA2B4D = { - isa = PBXBundleReference; + explicitFileType = wrapper.cfbundle; + isa = PBXFileReference; path = AppleBMacEthernet.kext; refType = 3; + sourceTree = BUILT_PRODUCTS_DIR; }; 01FC073DFFB0F85611CA2B4D = { - buildRules = ( - ); buildSettings = { COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_OPTIMIZATION_LEVEL = 0; OPTIMIZATION_CFLAGS = "-O0"; + ZERO_LINK = YES; }; isa = PBXBuildStyle; name = Development; }; 01FC073EFFB0F85611CA2B4D = { - buildRules = ( - ); buildSettings = { COPY_PHASE_STRIP = YES; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + ZERO_LINK = NO; }; isa = PBXBuildStyle; name = Deployment; @@ -48,50 +53,66 @@ 020A398BFFB0FA9711CA2B4D = { fileEncoding = 30; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = BMacEnetPrivate.h; refType = 4; + sourceTree = ""; }; 020A398CFFB0FA9711CA2B4D = { fileEncoding = 30; isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; path = BMacEnetPrivate.cpp; refType = 4; + sourceTree = ""; }; 020A398DFFB0FA9711CA2B4D = { fileEncoding = 30; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = BMacEnetMII.h; refType = 4; + sourceTree = ""; }; 020A398EFFB0FA9711CA2B4D = { fileEncoding = 30; isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; path = BMacEnetMII.cpp; refType = 4; + sourceTree = ""; }; 020A398FFFB0FA9711CA2B4D = { fileEncoding = 30; isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; path = BMacEnetHW.cpp; refType = 4; + sourceTree = ""; }; 020A3990FFB0FA9711CA2B4D = { fileEncoding = 30; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = BMacEnet.h; refType = 4; + sourceTree = ""; }; 020A3991FFB0FA9711CA2B4D = { fileEncoding = 30; isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; path = BMacEnet.cpp; refType = 4; + sourceTree = ""; }; 020A3992FFB0FA9711CA2B4D = { fileEncoding = 30; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = BMacEnetRegisters.h; refType = 4; + sourceTree = ""; }; 020A3993FFB0FA9711CA2B4D = { fileRef = 020A3992FFB0FA9711CA2B4D; @@ -154,6 +175,8 @@ //083 //084 089C1669FE841209C02AAC07 = { + buildSettings = { + }; buildStyles = ( 01FC073DFFB0F85611CA2B4D, 01FC073EFFB0F85611CA2B4D, @@ -176,6 +199,7 @@ isa = PBXGroup; name = AppleBMacEthernet; refType = 4; + sourceTree = ""; }; 089C1673FE841209C02AAC07 = { buildPhases = ( @@ -194,7 +218,7 @@ LIBRARY_SEARCH_PATHS = ""; MODULE_IOKIT = YES; MODULE_NAME = com.apple.driver.AppleBMacEthernet; - MODULE_VERSION = "\U00011.2.0f1"; + MODULE_VERSION = "\U00011.3.0f1"; OTHER_CFLAGS = ""; OTHER_LDFLAGS = ""; OTHER_REZFLAGS = ""; @@ -228,11 +252,11 @@ CFBundlePackageType KEXT CFBundleShortVersionString - 1.2.0 + 1.3.0 CFBundleSignature ???? CFBundleVersion - 1.2.0f1 + 1.3.0f1 IOKitPersonalities Name Matching @@ -253,15 +277,17 @@ OSBundleLibraries com.apple.iokit.IONetworkingFamily - 1.1 + 1.4.3 com.apple.kernel.bsd - 1.1 + 6.9.9 com.apple.kernel.iokit - 1.1 + 6.9.9 com.apple.kernel.libkern - 1.1 + 6.9.9 com.apple.kernel.mach - 1.1 + 6.9.9 + com.apple.kpi.bsd + 8.0.0b2 OSBundleRequired Network-Root @@ -320,6 +346,7 @@ isa = PBXGroup; name = Resources; refType = 4; + sourceTree = ""; }; 089C167DFE841241C02AAC07 = { children = ( @@ -328,13 +355,16 @@ isa = PBXVariantGroup; name = InfoPlist.strings; refType = 4; + sourceTree = ""; }; 089C167EFE841241C02AAC07 = { fileEncoding = 10; isa = PBXFileReference; + lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; refType = 4; + sourceTree = ""; }; 089C1680FE841241C02AAC07 = { fileRef = 089C167DFE841241C02AAC07; @@ -359,6 +389,7 @@ isa = PBXGroup; name = Products; refType = 4; + sourceTree = ""; }; //190 //191 @@ -385,6 +416,7 @@ name = Source; path = ""; refType = 4; + sourceTree = ""; }; //240 //241 @@ -416,9 +448,6 @@ name = "bmac-installer"; passBuildSettingsInEnvironment = 1; productName = "bmac-installer"; - settingsToExpand = 6; - settingsToPassInEnvironment = 287; - settingsToPassOnCommandLine = 280; }; }; rootObject = 089C1669FE841209C02AAC07; Index: English.lproj/InfoPlist.strings =================================================================== RCS file: /cvs/root/IO/Drivers/Ethernet/AppleBMacEthernet/English.lproj/InfoPlist.strings,v retrieving revision 1.5 diff -u -d -b -w -r1.5 InfoPlist.strings Binary files /tmp/cvsXBdeBU and InfoPlist.strings differ