#include <linux/errno.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/cdrom.h>
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.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(…);
#define USBAT_DEV_HP8200 …
#define USBAT_DEV_FLASH …
#define USBAT_EPP_PORT …
#define USBAT_EPP_REGISTER …
#define USBAT_ATA …
#define USBAT_ISA …
#define USBAT_CMD_READ_REG …
#define USBAT_CMD_WRITE_REG …
#define USBAT_CMD_READ_BLOCK …
#define USBAT_CMD_WRITE_BLOCK …
#define USBAT_CMD_COND_READ_BLOCK …
#define USBAT_CMD_COND_WRITE_BLOCK …
#define USBAT_CMD_WRITE_REGS …
#define USBAT_CMD_EXEC_CMD …
#define USBAT_CMD_SET_FEAT …
#define USBAT_CMD_UIO …
#define USBAT_UIO_READ …
#define USBAT_UIO_WRITE …
#define USBAT_QUAL_FCQ …
#define USBAT_QUAL_ALQ …
#define USBAT_FLASH_MEDIA_NONE …
#define USBAT_FLASH_MEDIA_CF …
#define USBAT_FLASH_MEDIA_SAME …
#define USBAT_FLASH_MEDIA_CHANGED …
#define USBAT_ATA_DATA …
#define USBAT_ATA_FEATURES …
#define USBAT_ATA_ERROR …
#define USBAT_ATA_SECCNT …
#define USBAT_ATA_SECNUM …
#define USBAT_ATA_LBA_ME …
#define USBAT_ATA_LBA_HI …
#define USBAT_ATA_DEVICE …
#define USBAT_ATA_STATUS …
#define USBAT_ATA_CMD …
#define USBAT_ATA_ALTSTATUS …
#define USBAT_UIO_EPAD …
#define USBAT_UIO_CDT …
#define USBAT_UIO_1 …
#define USBAT_UIO_0 …
#define USBAT_UIO_EPP_ATA …
#define USBAT_UIO_UI1 …
#define USBAT_UIO_UI0 …
#define USBAT_UIO_INTR_ACK …
#define USBAT_UIO_DRVRST …
#define USBAT_UIO_ACKD …
#define USBAT_UIO_OE1 …
#define USBAT_UIO_OE0 …
#define USBAT_UIO_ADPRST …
#define USBAT_FEAT_ETEN …
#define USBAT_FEAT_U1 …
#define USBAT_FEAT_U0 …
#define USBAT_FEAT_ET1 …
#define USBAT_FEAT_ET2 …
struct usbat_info { … };
#define short_pack(LSB,MSB) …
#define LSB_of(s) …
#define MSB_of(s) …
static int transferred = …;
static int usbat_flash_transport(struct scsi_cmnd * srb, struct us_data *us);
static int usbat_hp8200e_transport(struct scsi_cmnd *srb, struct us_data *us);
static int init_usbat_cd(struct us_data *us);
static int init_usbat_flash(struct us_data *us);
#define UNUSUAL_DEV …
static struct usb_device_id usbat_usb_ids[] = …;
MODULE_DEVICE_TABLE(usb, usbat_usb_ids);
#undef UNUSUAL_DEV
#define UNUSUAL_DEV …
static struct us_unusual_dev usbat_unusual_dev_list[] = …;
#undef UNUSUAL_DEV
static void usbat_pack_ata_sector_cmd(unsigned char *buf,
unsigned char thistime,
u32 sector, unsigned char cmd)
{ … }
static int usbat_get_device_type(struct us_data *us)
{ … }
static int usbat_read(struct us_data *us,
unsigned char access,
unsigned char reg,
unsigned char *content)
{ … }
static int usbat_write(struct us_data *us,
unsigned char access,
unsigned char reg,
unsigned char content)
{ … }
static int usbat_bulk_read(struct us_data *us,
void* buf,
unsigned int len,
int use_sg)
{ … }
static int usbat_bulk_write(struct us_data *us,
void* buf,
unsigned int len,
int use_sg)
{ … }
static int usbat_execute_command(struct us_data *us,
unsigned char *commands,
unsigned int len)
{ … }
static int usbat_get_status(struct us_data *us, unsigned char *status)
{ … }
static int usbat_check_status(struct us_data *us)
{ … }
static int usbat_set_shuttle_features(struct us_data *us,
unsigned char external_trigger,
unsigned char epp_control,
unsigned char mask_byte,
unsigned char test_pattern,
unsigned char subcountH,
unsigned char subcountL)
{ … }
static int usbat_wait_not_busy(struct us_data *us, int minutes)
{ … }
static int usbat_read_block(struct us_data *us,
void* buf,
unsigned short len,
int use_sg)
{ … }
static int usbat_write_block(struct us_data *us,
unsigned char access,
void* buf,
unsigned short len,
int minutes,
int use_sg)
{ … }
static int usbat_hp8200e_rw_block_test(struct us_data *us,
unsigned char access,
unsigned char *registers,
unsigned char *data_out,
unsigned short num_registers,
unsigned char data_reg,
unsigned char status_reg,
unsigned char timeout,
unsigned char qualifier,
int direction,
void *buf,
unsigned short len,
int use_sg,
int minutes)
{ … }
static int usbat_multiple_write(struct us_data *us,
unsigned char *registers,
unsigned char *data_out,
unsigned short num_registers)
{ … }
static int usbat_read_blocks(struct us_data *us,
void* buffer,
int len,
int use_sg)
{ … }
static int usbat_write_blocks(struct us_data *us,
void* buffer,
int len,
int use_sg)
{ … }
static int usbat_read_user_io(struct us_data *us, unsigned char *data_flags)
{ … }
static int usbat_write_user_io(struct us_data *us,
unsigned char enable_flags,
unsigned char data_flags)
{ … }
static int usbat_device_reset(struct us_data *us)
{ … }
static int usbat_device_enable_cdt(struct us_data *us)
{ … }
static int usbat_flash_check_media_present(struct us_data *us,
unsigned char *uio)
{ … }
static int usbat_flash_check_media_changed(struct us_data *us,
unsigned char *uio)
{ … }
static int usbat_flash_check_media(struct us_data *us,
struct usbat_info *info)
{ … }
static int usbat_identify_device(struct us_data *us,
struct usbat_info *info)
{ … }
static int usbat_set_transport(struct us_data *us,
struct usbat_info *info,
int devicetype)
{ … }
static int usbat_flash_get_sector_count(struct us_data *us,
struct usbat_info *info)
{ … }
static int usbat_flash_read_data(struct us_data *us,
struct usbat_info *info,
u32 sector,
u32 sectors)
{ … }
static int usbat_flash_write_data(struct us_data *us,
struct usbat_info *info,
u32 sector,
u32 sectors)
{ … }
static int usbat_hp8200e_handle_read10(struct us_data *us,
unsigned char *registers,
unsigned char *data,
struct scsi_cmnd *srb)
{ … }
static int usbat_select_and_test_registers(struct us_data *us)
{ … }
static int init_usbat(struct us_data *us, int devicetype)
{ … }
static int usbat_hp8200e_transport(struct scsi_cmnd *srb, struct us_data *us)
{ … }
static int usbat_flash_transport(struct scsi_cmnd * srb, struct us_data *us)
{ … }
static int init_usbat_cd(struct us_data *us)
{ … }
static int init_usbat_flash(struct us_data *us)
{ … }
static struct scsi_host_template usbat_host_template;
static int usbat_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{ … }
static struct usb_driver usbat_driver = …;
module_usb_stor_driver(usbat_driver, usbat_host_template, DRV_NAME);