<commit_before>#include <linux/sched.h>
#include <linux/errno.h>
#include <linux/freezer.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/kthread.h>
#include <linux/mutex.h>
#include <linux/utsname.h>

#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>

#include "usb.h"
#include "scsiglue.h"
#include "transport.h"

/* Some informational data */
MODULE_AUTHOR("Domao");
MODULE_DESCRIPTION("ENE USB Mass Storage driver for Linux");
MODULE_LICENSE("GPL");

static struct usb_device_id eucr_usb_ids [] = {
	{ USB_DEVICE(0x058f, 0x6366) },
	{ USB_DEVICE(0x0cf2, 0x6230) },
	{ USB_DEVICE(0x0cf2, 0x6250) },
	{ }                                            /* Terminating entry */
};
MODULE_DEVICE_TABLE (usb, eucr_usb_ids);



int eucr_suspend(struct usb_interface *iface, pm_message_t message)
{
	struct us_data *us = usb_get_intfdata(iface);
	printk("--- eucr_suspend ---\n");
	/* Wait until no command is running */
	mutex_lock(&us->dev_mutex);

	//US_DEBUGP("%s\n", __func__);
	if (us->suspend_resume_hook)
		(us->suspend_resume_hook)(us, US_SUSPEND);

	/* When runtime PM is working, we'll set a flag to indicate
	 * whether we should autoresume when a SCSI request arrives. */
	// us->Power_IsResum = true;
	//us->SD_Status.Ready = 0;

	mutex_unlock(&us->dev_mutex);
	return 0;
}
//EXPORT_SYMBOL_GPL(eucr_suspend);

int eucr_resume(struct usb_interface *iface)
{
	BYTE    tmp = 0;

	struct us_data *us = usb_get_intfdata(iface);
	printk("--- eucr_resume---\n");
	mutex_lock(&us->dev_mutex);

	//US_DEBUGP("%s\n", __func__);
	if (us->suspend_resume_hook)
		(us->suspend_resume_hook)(us, US_RESUME);


	mutex_unlock(&us->dev_mutex);

	
         us->Power_IsResum = true;
	//
	//us->SD_Status.Ready = 0; //??
	us->SD_Status = *(PSD_STATUS)&tmp;
    	us->MS_Status = *(PMS_STATUS)&tmp;
    	us->SM_Status = *(PSM_STATUS)&tmp;
    	
	return 0;
}
//EXPORT_SYMBOL_GPL(eucr_resume);
int eucr_reset_resume(struct usb_interface *iface)
{
	BYTE    tmp = 0;
	struct us_data *us = usb_get_intfdata(iface);

	printk("--- eucr_reset_resume---\n");
	//US_DEBUGP("%s\n", __func__);

	/* Report the reset to the SCSI core */
	usb_stor_report_bus_reset(us);

	/* FIXME: Notify the subdrivers that they need to reinitialize
	 * the device */
	//ENE_InitMedia(us);
 	us->Power_IsResum = true;
	//
	//us->SD_Status.Ready = 0; //??
	us->SD_Status = *(PSD_STATUS)&tmp;
    	us->MS_Status = *(PMS_STATUS)&tmp;
    	us->SM_Status = *(PSM_STATUS)&tmp;
	return 0;
}
//EXPORT_SYMBOL_GPL(usb_stor_reset_resume);

//----- eucr_pre_reset() ---------------------
static int eucr_pre_reset(struct usb_interface *iface)
{<commit_msg>staging/keucr: fix build when CONFIG_PM is not enabled<commit_after>#include <linux/sched.h>
#include <linux/errno.h>
#include <linux/freezer.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/kthread.h>
#include <linux/mutex.h>
#include <linux/utsname.h>

#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>

#include "usb.h"
#include "scsiglue.h"
#include "transport.h"

/* Some informational data */
MODULE_AUTHOR("Domao");
MODULE_DESCRIPTION("ENE USB Mass Storage driver for Linux");
MODULE_LICENSE("GPL");

static struct usb_device_id eucr_usb_ids [] = {
	{ USB_DEVICE(0x058f, 0x6366) },
	{ USB_DEVICE(0x0cf2, 0x6230) },
	{ USB_DEVICE(0x0cf2, 0x6250) },
	{ }                                            /* Terminating entry */
};
MODULE_DEVICE_TABLE (usb, eucr_usb_ids);


#ifdef CONFIG_PM

int eucr_suspend(struct usb_interface *iface, pm_message_t message)
{
	struct us_data *us = usb_get_intfdata(iface);
	printk("--- eucr_suspend ---\n");
	/* Wait until no command is running */
	mutex_lock(&us->dev_mutex);

	//US_DEBUGP("%s\n", __func__);
	if (us->suspend_resume_hook)
		(us->suspend_resume_hook)(us, US_SUSPEND);

	/* When runtime PM is working, we'll set a flag to indicate
	 * whether we should autoresume when a SCSI request arrives. */
	// us->Power_IsResum = true;
	//us->SD_Status.Ready = 0;

	mutex_unlock(&us->dev_mutex);
	return 0;
}
//EXPORT_SYMBOL_GPL(eucr_suspend);

int eucr_resume(struct usb_interface *iface)
{
	BYTE    tmp = 0;

	struct us_data *us = usb_get_intfdata(iface);
	printk("--- eucr_resume---\n");
	mutex_lock(&us->dev_mutex);

	//US_DEBUGP("%s\n", __func__);
	if (us->suspend_resume_hook)
		(us->suspend_resume_hook)(us, US_RESUME);


	mutex_unlock(&us->dev_mutex);

	
         us->Power_IsResum = true;
	//
	//us->SD_Status.Ready = 0; //??
	us->SD_Status = *(PSD_STATUS)&tmp;
    	us->MS_Status = *(PMS_STATUS)&tmp;
    	us->SM_Status = *(PSM_STATUS)&tmp;
    	
	return 0;
}
//EXPORT_SYMBOL_GPL(eucr_resume);
int eucr_reset_resume(struct usb_interface *iface)
{
	BYTE    tmp = 0;
	struct us_data *us = usb_get_intfdata(iface);

	printk("--- eucr_reset_resume---\n");
	//US_DEBUGP("%s\n", __func__);

	/* Report the reset to the SCSI core */
	usb_stor_report_bus_reset(us);

	/* FIXME: Notify the subdrivers that they need to reinitialize
	 * the device */
	//ENE_InitMedia(us);
 	us->Power_IsResum = true;
	//
	//us->SD_Status.Ready = 0; //??
	us->SD_Status = *(PSD_STATUS)&tmp;
    	us->MS_Status = *(PMS_STATUS)&tmp;
    	us->SM_Status = *(PSM_STATUS)&tmp;
	return 0;
}
//EXPORT_SYMBOL_GPL(usb_stor_reset_resume);

#else

#define eucr_suspend		NULL
#define eucr_resume		NULL
#define eucr_reset_resume	NULL

#endif

//----- eucr_pre_reset() ---------------------
static int eucr_pre_reset(struct usb_interface *iface)
{
{'fraction_non_alphanumeric': 0.16642441860465115, 'fraction_numerical': 0.011991279069767442, 'mean_word_length': 3.850220264317181, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 67, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4524251', 'n_tokens_mistral': 2227, 'n_tokens_neox': 2194, 'n_words': 418}