linux/drivers/usb/storage/realtek_cr.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Driver for Realtek RTS51xx USB card reader
 *
 * Copyright(c) 2009 Realtek Semiconductor Corp. All rights reserved.
 *
 * Author:
 *   wwang ([email protected])
 *   No. 450, Shenhu Road, Suzhou Industry Park, Suzhou, China
 */

#include <linux/module.h>
#include <linux/blkdev.h>
#include <linux/kthread.h>
#include <linux/sched.h>
#include <linux/kernel.h>

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

#include <linux/usb.h>
#include <linux/slab.h>
#include <linux/usb_usual.h>

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

#define DRV_NAME

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();
MODULE_IMPORT_NS();

static int auto_delink_en =;
module_param(auto_delink_en, int, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC();

#ifdef CONFIG_REALTEK_AUTOPM
static int ss_en =;
module_param(ss_en, int, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC();

static int ss_delay =;
module_param(ss_delay, int, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC();

enum RTS51X_STAT {};

#define POLLING_INTERVAL

#define rts51x_set_stat(chip, stat)
#define rts51x_get_stat(chip)

#define SET_LUN_READY(chip, lun)
#define CLR_LUN_READY(chip, lun)
#define TST_LUN_READY(chip, lun)

#endif

struct rts51x_status {};

struct rts51x_chip {};

/* flag definition */
#define FLIDX_AUTO_DELINK

#define SCSI_LUN(srb)

/* Bit Operation */
#define SET_BIT(data, idx)
#define CLR_BIT(data, idx)
#define CHK_BIT(data, idx)

#define SET_AUTO_DELINK(chip)
#define CLR_AUTO_DELINK(chip)
#define CHK_AUTO_DELINK(chip)

#define RTS51X_GET_VID(chip)
#define RTS51X_GET_PID(chip)

#define VENDOR_ID(chip)
#define PRODUCT_ID(chip)
#define FW_VERSION(chip)
#define STATUS_LEN(chip)

#define STATUS_SUCCESS
#define STATUS_FAIL

/* Check card reader function */
#define SUPPORT_DETAILED_TYPE1(chip)
#define SUPPORT_OT(chip)
#define SUPPORT_OC(chip)
#define SUPPORT_AUTO_DELINK(chip)
#define SUPPORT_SDIO(chip)
#define SUPPORT_DETAILED_TYPE2(chip)

#define CHECK_PID(chip, pid)
#define CHECK_FW_VER(chip, fw_ver)
#define CHECK_ID(chip, pid, fw_ver)

static int init_realtek_cr(struct us_data *us);

/*
 * The table of devices
 */
#define UNUSUAL_DEV

static const struct usb_device_id realtek_cr_ids[] =;

MODULE_DEVICE_TABLE(usb, realtek_cr_ids);

#undef UNUSUAL_DEV

/*
 * The flags table
 */
#define UNUSUAL_DEV

static struct us_unusual_dev realtek_cr_unusual_dev_list[] =;

#undef UNUSUAL_DEV

static int rts51x_bulk_transport(struct us_data *us, u8 lun,
				 u8 *cmd, int cmd_len, u8 *buf, int buf_len,
				 enum dma_data_direction dir, int *act_len)
{}

static int rts51x_bulk_transport_special(struct us_data *us, u8 lun,
				 u8 *cmd, int cmd_len, u8 *buf, int buf_len,
				 enum dma_data_direction dir, int *act_len)
{}

/* Determine what the maximum LUN supported is */
static int rts51x_get_max_lun(struct us_data *us)
{}

static int rts51x_read_mem(struct us_data *us, u16 addr, u8 *data, u16 len)
{}

static int rts51x_write_mem(struct us_data *us, u16 addr, u8 *data, u16 len)
{}

static int rts51x_read_status(struct us_data *us,
			      u8 lun, u8 *status, int len, int *actlen)
{}

static int rts51x_check_status(struct us_data *us, u8 lun)
{}

static int enable_oscillator(struct us_data *us)
{}

static int __do_config_autodelink(struct us_data *us, u8 *data, u16 len)
{}

static int do_config_autodelink(struct us_data *us, int enable, int force)
{}

static int config_autodelink_after_power_on(struct us_data *us)
{}

#ifdef CONFIG_PM
static int config_autodelink_before_power_down(struct us_data *us)
{}

static void fw5895_init(struct us_data *us)
{}
#endif

#ifdef CONFIG_REALTEK_AUTOPM
static void fw5895_set_mmc_wp(struct us_data *us)
{}

static void rts51x_modi_suspend_timer(struct rts51x_chip *chip)
{}

static void rts51x_suspend_timer_fn(struct timer_list *t)
{}

static inline int working_scsi(struct scsi_cmnd *srb)
{}

static void rts51x_invoke_transport(struct scsi_cmnd *srb, struct us_data *us)
{}

static int realtek_cr_autosuspend_setup(struct us_data *us)
{}
#endif

static void realtek_cr_destructor(void *extra)
{}

#ifdef CONFIG_PM
static int realtek_cr_suspend(struct usb_interface *iface, pm_message_t message)
{}

static int realtek_cr_resume(struct usb_interface *iface)
{}
#else
#define realtek_cr_suspend
#define realtek_cr_resume
#endif

static int init_realtek_cr(struct us_data *us)
{}

static struct scsi_host_template realtek_cr_host_template;

static int realtek_cr_probe(struct usb_interface *intf,
			    const struct usb_device_id *id)
{}

static struct usb_driver realtek_cr_driver =;

module_usb_stor_driver(realtek_cr_driver, realtek_cr_host_template, DRV_NAME);