dev_shut.c 1.82 KB
/*HEADER******************************************************************
**************************************************************************
*** 
*** Copyright (c) 2001-2002 ARC International.
*** All rights reserved                                          
***                                                              
*** This software embodies materials and concepts which are      
*** confidential to ARC International and is made
*** available solely pursuant to the terms of a written license   
*** agreement with ARC International             
***
*** $Workfile:devapi.c$
*** $Revision: 1.2 $
*** $Date: 2003/04/10 06:01:53 $
***
*** Comments:      
***   This file contains the USB device API.
***                                                               
**************************************************************************
*END*********************************************************************/

#include "os_bb.h"
#include "osint.h"
   

/*FUNCTION*-------------------------------------------------------------
*
*  Function Name  : _usb_device_shutdown
*  Returned Value : USB_OK or error code
*  Comments       :
*        Shutdown an initialized USB device
*
*END*-----------------------------------------------------------------*/
void _usb_device_shutdown
   (
      /* [IN] the USB_USB_dev_initialize state structure */
      _usb_device_handle         handle
   )
{ /* Body */
   USB_DEV_STATE_STRUCT_PTR         usb_dev_ptr;

   usb_dev_ptr = (USB_DEV_STATE_STRUCT_PTR)handle;

   _usb_dci_vusb11_shutdown((_usb_device_handle)usb_dev_ptr);

   osFree(__usb_svc_callback_reg, (void *)(usb_dev_ptr->SERVICE_HEAD_PTR));

   /* Free all internal transfer descriptors */
   osFree(__usb_endpt_desc_reg, (void *)(usb_dev_ptr->XDSEND));
   osFree(__usb_endpt_desc_reg, (void *)(usb_dev_ptr->XDRECV));

} /* EndBody */