#include <linux/blk-mq.h>
#include <linux/idr.h>
#include <linux/hdreg.h>
#include <linux/kthread.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/mutex.h>
#include <linux/memstick.h>
#include <linux/module.h>
#define DRIVER_NAME …
static int major;
module_param(major, int, 0644);
#define MSPRO_BLOCK_MAX_SEGS …
#define MSPRO_BLOCK_MAX_PAGES …
#define MSPRO_BLOCK_SIGNATURE …
#define MSPRO_BLOCK_MAX_ATTRIBUTES …
#define MSPRO_BLOCK_PART_SHIFT …
enum { … };
struct mspro_sys_attr { … };
struct mspro_attr_entry { … } __attribute__((packed));
struct mspro_attribute { … } __attribute__((packed));
struct mspro_sys_info { … } __attribute__((packed));
struct mspro_mbr { … } __attribute__((packed));
struct mspro_specfile { … } __attribute__((packed));
struct mspro_devinfo { … } __attribute__((packed));
struct mspro_block_data { … };
static DEFINE_IDR(mspro_block_disk_idr);
static DEFINE_MUTEX(mspro_block_disk_lock);
static int mspro_block_complete_req(struct memstick_dev *card, int error);
static void mspro_block_bd_free_disk(struct gendisk *disk)
{ … }
static int mspro_block_bd_getgeo(struct block_device *bdev,
struct hd_geometry *geo)
{ … }
static const struct block_device_operations ms_block_bdops = …;
static struct mspro_sys_attr *mspro_from_sysfs_attr(struct attribute *attr)
{ … }
static const char *mspro_block_attr_name(unsigned char tag)
{ … }
sysfs_show_t;
static ssize_t mspro_block_attr_show_default(struct device *dev,
struct device_attribute *attr,
char *buffer)
{ … }
static ssize_t mspro_block_attr_show_sysinfo(struct device *dev,
struct device_attribute *attr,
char *buffer)
{ … }
static ssize_t mspro_block_attr_show_modelname(struct device *dev,
struct device_attribute *attr,
char *buffer)
{ … }
static ssize_t mspro_block_attr_show_mbr(struct device *dev,
struct device_attribute *attr,
char *buffer)
{ … }
static ssize_t mspro_block_attr_show_specfile(struct device *dev,
struct device_attribute *attr,
char *buffer)
{ … }
static ssize_t mspro_block_attr_show_devinfo(struct device *dev,
struct device_attribute *attr,
char *buffer)
{ … }
static sysfs_show_t mspro_block_attr_show(unsigned char tag)
{ … }
static int h_mspro_block_req_init(struct memstick_dev *card,
struct memstick_request **mrq)
{ … }
static int h_mspro_block_default(struct memstick_dev *card,
struct memstick_request **mrq)
{ … }
static int h_mspro_block_default_bad(struct memstick_dev *card,
struct memstick_request **mrq)
{ … }
static int h_mspro_block_get_ro(struct memstick_dev *card,
struct memstick_request **mrq)
{ … }
static int h_mspro_block_wait_for_ced(struct memstick_dev *card,
struct memstick_request **mrq)
{ … }
static int h_mspro_block_transfer_data(struct memstick_dev *card,
struct memstick_request **mrq)
{ … }
static void h_mspro_block_setup_cmd(struct memstick_dev *card, u64 offset,
size_t length)
{ … }
static int mspro_block_issue_req(struct memstick_dev *card)
{ … }
static int mspro_block_complete_req(struct memstick_dev *card, int error)
{ … }
static void mspro_block_stop(struct memstick_dev *card)
{ … }
static void mspro_block_start(struct memstick_dev *card)
{ … }
static blk_status_t mspro_queue_rq(struct blk_mq_hw_ctx *hctx,
const struct blk_mq_queue_data *bd)
{ … }
static int mspro_block_wait_for_ced(struct memstick_dev *card)
{ … }
static int mspro_block_set_interface(struct memstick_dev *card,
unsigned char sys_reg)
{ … }
static int mspro_block_switch_interface(struct memstick_dev *card)
{ … }
static int mspro_block_read_attributes(struct memstick_dev *card)
{ … }
static int mspro_block_init_card(struct memstick_dev *card)
{ … }
static const struct blk_mq_ops mspro_mq_ops = …;
static int mspro_block_init_disk(struct memstick_dev *card)
{ … }
static void mspro_block_data_clear(struct mspro_block_data *msb)
{ … }
static int mspro_block_check_card(struct memstick_dev *card)
{ … }
static int mspro_block_probe(struct memstick_dev *card)
{ … }
static void mspro_block_remove(struct memstick_dev *card)
{ … }
#ifdef CONFIG_PM
static int mspro_block_suspend(struct memstick_dev *card, pm_message_t state)
{ … }
static int mspro_block_resume(struct memstick_dev *card)
{ … }
#else
#define mspro_block_suspend …
#define mspro_block_resume …
#endif
static struct memstick_device_id mspro_block_id_tbl[] = …;
static struct memstick_driver mspro_block_driver = …;
static int __init mspro_block_init(void)
{ … }
static void __exit mspro_block_exit(void)
{ … }
module_init(…) …;
module_exit(mspro_block_exit);
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_DEVICE_TABLE(memstick, mspro_block_id_tbl);