int RTMP_Usb_AutoPM_Put_Interface (void *pUsb_Devsrc, void *intfsrc)
{
	int pm_usage_cnt;
	struct usb_interface *intf = (struct usb_interface *)intfsrc;

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)
		pm_usage_cnt = atomic_read(&intf->pm_usage_cnt);
#else
		pm_usage_cnt = intf->pm_usage_cnt;
#endif

		if (pm_usage_cnt == 1) {
			rausb_autopm_put_interface(intf);
		}

	return 0;
}
Пример #2
0
int RTMP_Usb_AutoPM_Put_Interface (
	IN	VOID			*pUsb_Devsrc,
	IN	VOID			*intfsrc)
{

	INT	 pm_usage_cnt;

struct usb_device		*pUsb_Dev =(struct usb_device *)pUsb_Devsrc;	
struct usb_interface	*intf =(struct usb_interface *)intfsrc;


#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)
		pm_usage_cnt = atomic_read(&intf->pm_usage_cnt);	
#else
		pm_usage_cnt = intf->pm_usage_cnt;
#endif

		if(pm_usage_cnt == 1)
		{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
			if(pUsb_Dev->autosuspend_disabled  ==0)
#else
			if(pUsb_Dev->auto_pm ==1)
#endif
			{
					rausb_autopm_put_interface(intf);
			}
	
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
			else
			{
				DBGPRINT(RT_DEBUG_TRACE, ("STAMlmePeriodicExec: AsicRadioOff  fRTMP_ADAPTER_SUSPEND\n"));
/*				RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_SUSPEND); */
/*				RTMP_DRIVER_ADAPTER_SUSPEND_SET(pAd); */
				return (-1);
			}
#endif
                }

			return 0;
}