/* Create a data segment, pad it, and calculate the CRC if needed. */
NET_BUF* IScsiNewDataSegment(IN UINT8 *Data, IN UINT32 Len, IN BOOLEAN DataDigest)
/* Create a data segment, pad it, and calculate the CRC if needed. */
NET_BUF* IScsiNewDataSegment(IN UINT8 *Data, IN UINT32 Len, IN BOOLEAN DataDigest)
{
  NET_FRAGMENT  Fragment[2];
  UINT32        FragmentCount;
  UINT32        PadLen;
  NET_BUF       *DataSeg;
  Fragment[0].Len  = Len;
  Fragment[0].Bulk = Data;
  PadLen = ISCSI_GET_PAD_LEN (Len);
  if (PadLen != 0) {
    Fragment[1].Len  = PadLen;
    Fragment[1].Bulk = (UINT8 *)&mDataSegPad;
    FragmentCount = 2;
  } else {
    FragmentCount = 1;
  }
  DataSeg = NetbufFromExt (&Fragment[0], FragmentCount, 0, 0, IScsiNbufExtFree, NULL);
  return DataSeg;
}