/* Compute the checksum for a bulk of data. */
UINT16 EFIAPI NetblockChecksum(IN UINT8 *Bulk, IN UINT32 Len)
/* Compute the checksum for a bulk of data. */
UINT16 EFIAPI NetblockChecksum(IN UINT8 *Bulk, IN UINT32 Len)
{
  register UINT32  Sum;
  Sum = 0;
  if (Len % 2 != 0) {
    Sum += *(Bulk + Len - 1);
  }
  while (Len > 1) {
    Sum  += *(UINT16 *)Bulk;
    Bulk += 2;
    Len  -= 2;
  }
  while ((Sum >> 16) != 0) {
    Sum = (Sum & 0xffff) + (Sum >> 16);
  }
  return (UINT16)Sum;
}