/* Try to reclaim the Nbuf into the buffer pool. */
VOID MnpFreeNbuf(IN OUT MNP_DEVICE_DATA *MnpDeviceData, IN OUT NET_BUF *Nbuf)
/* Try to reclaim the Nbuf into the buffer pool. */
VOID MnpFreeNbuf(IN OUT MNP_DEVICE_DATA *MnpDeviceData, IN OUT NET_BUF *Nbuf)
{
  EFI_TPL  OldTpl;
  NET_CHECK_SIGNATURE (MnpDeviceData, MNP_DEVICE_DATA_SIGNATURE);
  ASSERT (Nbuf->RefCnt > 1);
  OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
  NET_PUT_REF (Nbuf);
  if (Nbuf->RefCnt == 1) {
    NetbufTrim (Nbuf, Nbuf->TotalSize, NET_BUF_TAIL);
    if (NetbufAllocSpace (Nbuf, NET_VLAN_TAG_LEN, NET_BUF_HEAD) != NULL) {
      NetbufTrim (Nbuf, NET_VLAN_TAG_LEN, NET_BUF_TAIL);
    }
    NetbufQueAppend (&MnpDeviceData->FreeNbufQue, Nbuf);
  }
  gBS->RestoreTPL (OldTpl);
}