Author: tkreuzer
Date: Sun Oct 25 12:55:04 2009
New Revision: 43739
URL:
http://svn.reactos.org/svn/reactos?rev=43739&view=rev
Log:
[KDCOM]
- Compare checksum after retreiving the full packet
- simplify code
Modified:
branches/ros-amd64-bringup/reactos/drivers/base/kddll/kddll.c
Modified: branches/ros-amd64-bringup/reactos/drivers/base/kddll/kddll.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/drive…
==============================================================================
--- branches/ros-amd64-bringup/reactos/drivers/base/kddll/kddll.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/drivers/base/kddll/kddll.c [iso-8859-1] Sun Oct 25
12:55:04 2009
@@ -307,6 +307,15 @@
}
}
+ /* We must receive a PACKET_TRAILING_BYTE now */
+ KdStatus = KdpReceiveBuffer(&Byte, sizeof(UCHAR));
+ if (KdStatus != KDP_PACKET_RECEIVED || Byte != PACKET_TRAILING_BYTE)
+ {
+ KDDBGPRINT("KdReceivePacket - wrong trailing byte (0x%x), status
0x%x\n", Byte, KdStatus);
+ KdpSendControlPacket(PACKET_TYPE_KD_RESEND, 0);
+ continue;
+ }
+
/* Compare checksum */
if (Packet.Checksum != Checksum)
{
@@ -316,30 +325,19 @@
continue;
}
- /* We must receive a PACKET_TRAILING_BYTE now */
- KdStatus = KdpReceiveBuffer(&Byte, sizeof(UCHAR));
- if (KdStatus != KDP_PACKET_RECEIVED || Byte != PACKET_TRAILING_BYTE)
- {
- KDDBGPRINT("KdReceivePacket - wrong trailing byte (0x%x), status
0x%x\n", Byte, KdStatus);
- KdpSendControlPacket(PACKET_TYPE_KD_RESEND, 0);
- continue;
- }
-
- /* Did we get the right packet type? */
- if (PacketType != Packet.PacketType)
- {
- /* We received something different, ignore it. */
- KDDBGPRINT("KdReceivePacket - wrong PacketType\n");
- KdpSendControlPacket(PACKET_TYPE_KD_ACKNOWLEDGE, Packet.PacketId);
- continue;
- }
-
/* Acknowledge the received packet */
KdpSendControlPacket(PACKET_TYPE_KD_ACKNOWLEDGE, Packet.PacketId);
- //KDDBGPRINT("KdReceivePacket - all ok\n");
-
- return KDP_PACKET_RECEIVED;
+ /* Did we get the right packet type? */
+ if (PacketType == Packet.PacketType)
+ {
+ /* Yes, return success */
+ //KDDBGPRINT("KdReceivePacket - all ok\n");
+ return KDP_PACKET_RECEIVED;
+ }
+
+ /* We received something different, ignore it. */
+ KDDBGPRINT("KdReceivePacket - wrong PacketType\n");
}
return KDP_PACKET_RECEIVED;