--- BasiliskII/src/Windows/ether_windows.cpp 2004/12/06 23:31:03 1.1 +++ BasiliskII/src/Windows/ether_windows.cpp 2005/03/19 17:43:03 1.3 @@ -1,7 +1,7 @@ /* * ether_windows.cpp - Ethernet device driver * - * Basilisk II (C) 1997-2004 Christian Bauer + * Basilisk II (C) 1997-2005 Christian Bauer * * Windows platform specific code copyright (C) Lauri Pesonen * @@ -1037,23 +1037,24 @@ static unsigned int ether_thread_feed_in void EtherInterrupt(void) { int length; - static uint8 packet[1514]; + EthernetPacket ether_packet; + uint32 packet = ether_packet.addr(); D(bug("EtherIRQ\r\n")); // Call protocol handler for received packets - while( (length = dequeue_packet(packet)) > 0 ) { + while( (length = dequeue_packet(Mac2HostAddr(packet))) > 0 ) { if (length < 14) continue; #if MONITOR bug("Receiving Ethernet packet (%d bytes):\n",(int)length); - dump_packet( packet, length ); + dump_packet( Mac2HostAddr(packet), length ); #endif // Get packet type - uint16 type = ntohs(*(uint16 *)(packet + 12)); + uint16 type = ReadMacInt16(packet + 12); // Look for protocol NetProtocol *prot = find_protocol(type); @@ -1067,7 +1068,7 @@ void EtherInterrupt(void) // break; // Copy header to RHA - memcpy(Mac2HostAddr(ether_data + ed_RHA), packet, 14); + Mac2Mac_memcpy(ether_data + ed_RHA, packet, 14); D(bug(" header %08lx%04lx %08lx%04lx %04lx\r\n", ReadMacInt32(ether_data + ed_RHA), ReadMacInt16(ether_data + ed_RHA + 4), ReadMacInt32(ether_data + ed_RHA + 6), ReadMacInt16(ether_data + ed_RHA + 10), ReadMacInt16(ether_data + ed_RHA + 12))); // Call protocol handler @@ -1075,7 +1076,7 @@ void EtherInterrupt(void) r.d[0] = type; // Packet type r.d[1] = length - 14; // Remaining packet length (without header, for ReadPacket) - r.a[0] = (uint32)packet + 14; // Pointer to packet (host address, for ReadPacket) + r.a[0] = packet + 14; // Pointer to packet (Mac address, for ReadPacket) r.a[3] = ether_data + ed_RHA + 14; // Pointer behind header in RHA r.a[4] = ether_data + ed_ReadPacket; // Pointer to ReadPacket/ReadRest routines D(bug(" calling protocol handler %08lx, type %08lx, length %08lx, data %08lx, rha %08lx, read_packet %08lx\r\n", prot->handler, r.d[0], r.d[1], r.a[0], r.a[3], r.a[4]));