Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
isd200.c File Reference
#include <linux/jiffies.h>
#include <linux/errno.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/ata.h>
#include <linux/hdreg.h>
#include <linux/scatterlist.h>
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>
#include "usb.h"
#include "transport.h"
#include "protocol.h"
#include "debug.h"
#include "scsiglue.h"
#include "unusual_isd200.h"

Go to the source code of this file.

Data Structures

union  ata_cdb
 
struct  inquiry_data
 
struct  isd200_config
 
struct  isd200_info
 
struct  read_capacity_data
 
struct  read_block_limits
 
struct  sense_data
 

Macros

#define UNUSUAL_DEV(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax, vendorName, productName, useProtocol, useTransport, initFunction, flags)
 
#define UNUSUAL_DEV(idVendor, idProduct, bcdDeviceMin, bcdDeviceMax, vendor_name, product_name, use_protocol, use_transport, init_function, Flags)
 
#define ISD200_ENUM_BSY_TIMEOUT   35
 
#define ISD200_ENUM_DETECT_TIMEOUT   30
 
#define ISD200_DEFAULT_TIMEOUT   30
 
#define DF_ATA_DEVICE   0x0001
 
#define DF_MEDIA_STATUS_ENABLED   0x0002
 
#define DF_REMOVABLE_MEDIA   0x0004
 
#define CAPABILITY_DMA   0x01
 
#define CAPABILITY_LBA   0x02
 
#define COMMANDSET_REMOVABLE   0x02
 
#define COMMANDSET_MEDIA_STATUS   0x10
 
#define ATA_ADDRESS_DEVHEAD_STD   0xa0
 
#define ATA_ADDRESS_DEVHEAD_LBA_MODE   0x40
 
#define ATA_ADDRESS_DEVHEAD_SLAVE   0x10
 
#define ACTION_SELECT_0   0x01
 
#define ACTION_SELECT_1   0x02
 
#define ACTION_SELECT_2   0x04
 
#define ACTION_SELECT_3   0x08
 
#define ACTION_SELECT_4   0x10
 
#define ACTION_SELECT_5   0x20
 
#define ACTION_SELECT_6   0x40
 
#define ACTION_SELECT_7   0x80
 
#define REG_ALTERNATE_STATUS   0x01
 
#define REG_DEVICE_CONTROL   0x01
 
#define REG_ERROR   0x02
 
#define REG_FEATURES   0x02
 
#define REG_SECTOR_COUNT   0x04
 
#define REG_SECTOR_NUMBER   0x08
 
#define REG_CYLINDER_LOW   0x10
 
#define REG_CYLINDER_HIGH   0x20
 
#define REG_DEVICE_HEAD   0x40
 
#define REG_STATUS   0x80
 
#define REG_COMMAND   0x80
 
#define ATA_REG_ERROR_OFFSET   1
 
#define ATA_REG_LCYL_OFFSET   4
 
#define ATA_REG_HCYL_OFFSET   5
 
#define ATA_REG_STATUS_OFFSET   7
 
#define ATA_ERROR_MEDIA_CHANGE   0x20
 
#define ATA_COMMAND_GET_MEDIA_STATUS   0xDA
 
#define ATA_COMMAND_MEDIA_EJECT   0xED
 
#define ATA_DC_DISABLE_INTERRUPTS   0x02
 
#define ATA_DC_RESET_CONTROLLER   0x04
 
#define ATA_DC_REENABLE_CONTROLLER   0x00
 
#define ISD200_ERROR   -1
 
#define ISD200_GOOD   0
 
#define ISD200_TRANSPORT_GOOD   0 /* Transport good, command good */
 
#define ISD200_TRANSPORT_FAILED   1 /* Transport good, command failed */
 
#define ISD200_TRANSPORT_ERROR   2 /* Transport bad (i.e. device dead) */
 
#define ACTION_READ_STATUS   0
 
#define ACTION_RESET   1
 
#define ACTION_REENABLE   2
 
#define ACTION_SOFT_RESET   3
 
#define ACTION_ENUM   4
 
#define ACTION_IDENTIFY   5
 
#define DIRECT_ACCESS_DEVICE   0x00 /* disks */
 
#define DEVICE_REMOVABLE   0x80
 
#define INQUIRYDATABUFFERSIZE   36
 
#define ATACFG_TIMING   0x0f
 
#define ATACFG_ATAPI_RESET   0x10
 
#define ATACFG_MASTER   0x20
 
#define ATACFG_BLOCKSIZE   0xa0
 
#define ATACFGE_LAST_LUN   0x07
 
#define ATACFGE_DESC_OVERRIDE   0x08
 
#define ATACFGE_STATE_SUSPEND   0x10
 
#define ATACFGE_SKIP_BOOT   0x20
 
#define ATACFGE_CONF_DESC2   0x40
 
#define ATACFGE_INIT_STATUS   0x80
 
#define CFG_CAPABILITY_SRST   0x01
 
#define SENSE_ERRCODE   0x7f
 
#define SENSE_ERRCODE_VALID   0x80
 
#define SENSE_FLAG_SENSE_KEY   0x0f
 
#define SENSE_FLAG_BAD_LENGTH   0x20
 
#define SENSE_FLAG_END_OF_MEDIA   0x40
 
#define SENSE_FLAG_FILE_MARK   0x80
 
#define SENSE_BUFFER_SIZE   18
 

Functions

 MODULE_DESCRIPTION ("Driver for In-System Design, Inc. ISD200 ASIC")
 
 MODULE_AUTHOR ("Björn Stenberg <[email protected]>")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_DEVICE_TABLE (usb, isd200_usb_ids)
 
struct inquiry_data __attribute__ ((packed))
 
 module_usb_driver (isd200_driver)
 

Variables

unsigned char DeviceType
 
unsigned char DeviceTypeModifier
 
unsigned char Versions
 
unsigned char Format
 
unsigned char AdditionalLength
 
unsigned char Reserved [2]
 
unsigned char Capability
 
unsigned char VendorId [8]
 
unsigned char ProductId [16]
 
unsigned char ProductRevisionLevel [4]
 
unsigned char VendorSpecific [20]
 
unsigned char Reserved3 [40]
 
unsigned char EventNotification
 
unsigned char ExternalClock
 
unsigned char ATAInitTimeout
 
unsigned char ATAConfig
 
unsigned char ATAMajorCommand
 
unsigned char ATAMinorCommand
 
unsigned char ATAExtraConfig
 
struct isd200_info __attribute__
 
unsigned char ErrorCode
 
unsigned char SegmentNumber
 
unsigned char Flags
 
unsigned char Information [4]
 
unsigned char AdditionalSenseLength
 
unsigned char CommandSpecificInformation [4]
 
unsigned char AdditionalSenseCode
 
unsigned char AdditionalSenseCodeQualifier
 
unsigned char FieldReplaceableUnitCode
 
unsigned char SenseKeySpecific [3]
 

Macro Definition Documentation

#define ACTION_ENUM   4

Definition at line 193 of file isd200.c.

#define ACTION_IDENTIFY   5

Definition at line 194 of file isd200.c.

#define ACTION_READ_STATUS   0

Definition at line 189 of file isd200.c.

#define ACTION_REENABLE   2

Definition at line 191 of file isd200.c.

#define ACTION_RESET   1

Definition at line 190 of file isd200.c.

#define ACTION_SELECT_0   0x01

Definition at line 133 of file isd200.c.

#define ACTION_SELECT_1   0x02

Definition at line 134 of file isd200.c.

#define ACTION_SELECT_2   0x04

Definition at line 135 of file isd200.c.

#define ACTION_SELECT_3   0x08

Definition at line 136 of file isd200.c.

#define ACTION_SELECT_4   0x10

Definition at line 137 of file isd200.c.

#define ACTION_SELECT_5   0x20

Definition at line 138 of file isd200.c.

#define ACTION_SELECT_6   0x40

Definition at line 139 of file isd200.c.

#define ACTION_SELECT_7   0x80

Definition at line 140 of file isd200.c.

#define ACTION_SOFT_RESET   3

Definition at line 192 of file isd200.c.

#define ATA_ADDRESS_DEVHEAD_LBA_MODE   0x40

Definition at line 129 of file isd200.c.

#define ATA_ADDRESS_DEVHEAD_SLAVE   0x10

Definition at line 130 of file isd200.c.

#define ATA_ADDRESS_DEVHEAD_STD   0xa0

Definition at line 128 of file isd200.c.

#define ATA_COMMAND_GET_MEDIA_STATUS   0xDA

Definition at line 165 of file isd200.c.

#define ATA_COMMAND_MEDIA_EJECT   0xED

Definition at line 166 of file isd200.c.

#define ATA_DC_DISABLE_INTERRUPTS   0x02

Definition at line 169 of file isd200.c.

#define ATA_DC_REENABLE_CONTROLLER   0x00

Definition at line 171 of file isd200.c.

#define ATA_DC_RESET_CONTROLLER   0x04

Definition at line 170 of file isd200.c.

#define ATA_ERROR_MEDIA_CHANGE   0x20

Definition at line 162 of file isd200.c.

#define ATA_REG_ERROR_OFFSET   1

Definition at line 156 of file isd200.c.

#define ATA_REG_HCYL_OFFSET   5

Definition at line 158 of file isd200.c.

#define ATA_REG_LCYL_OFFSET   4

Definition at line 157 of file isd200.c.

#define ATA_REG_STATUS_OFFSET   7

Definition at line 159 of file isd200.c.

#define ATACFG_ATAPI_RESET   0x10

Definition at line 298 of file isd200.c.

#define ATACFG_BLOCKSIZE   0xa0

Definition at line 300 of file isd200.c.

#define ATACFG_MASTER   0x20

Definition at line 299 of file isd200.c.

#define ATACFG_TIMING   0x0f

Definition at line 297 of file isd200.c.

#define ATACFGE_CONF_DESC2   0x40

Definition at line 306 of file isd200.c.

#define ATACFGE_DESC_OVERRIDE   0x08

Definition at line 303 of file isd200.c.

#define ATACFGE_INIT_STATUS   0x80

Definition at line 307 of file isd200.c.

#define ATACFGE_LAST_LUN   0x07

Definition at line 302 of file isd200.c.

#define ATACFGE_SKIP_BOOT   0x20

Definition at line 305 of file isd200.c.

#define ATACFGE_STATE_SUSPEND   0x10

Definition at line 304 of file isd200.c.

#define CAPABILITY_DMA   0x01

Definition at line 120 of file isd200.c.

#define CAPABILITY_LBA   0x02

Definition at line 121 of file isd200.c.

#define CFG_CAPABILITY_SRST   0x01

Definition at line 309 of file isd200.c.

#define COMMANDSET_MEDIA_STATUS   0x10

Definition at line 125 of file isd200.c.

#define COMMANDSET_REMOVABLE   0x02

Definition at line 124 of file isd200.c.

#define DEVICE_REMOVABLE   0x80

Definition at line 269 of file isd200.c.

#define DF_ATA_DEVICE   0x0001

Definition at line 115 of file isd200.c.

#define DF_MEDIA_STATUS_ENABLED   0x0002

Definition at line 116 of file isd200.c.

#define DF_REMOVABLE_MEDIA   0x0004

Definition at line 117 of file isd200.c.

#define DIRECT_ACCESS_DEVICE   0x00 /* disks */

Definition at line 268 of file isd200.c.

#define INQUIRYDATABUFFERSIZE   36

Definition at line 290 of file isd200.c.

#define ISD200_DEFAULT_TIMEOUT   30

Definition at line 112 of file isd200.c.

#define ISD200_ENUM_BSY_TIMEOUT   35

Definition at line 110 of file isd200.c.

#define ISD200_ENUM_DETECT_TIMEOUT   30

Definition at line 111 of file isd200.c.

#define ISD200_ERROR   -1

Definition at line 177 of file isd200.c.

#define ISD200_GOOD   0

Definition at line 178 of file isd200.c.

#define ISD200_TRANSPORT_ERROR   2 /* Transport bad (i.e. device dead) */

Definition at line 186 of file isd200.c.

#define ISD200_TRANSPORT_FAILED   1 /* Transport good, command failed */

Definition at line 185 of file isd200.c.

#define ISD200_TRANSPORT_GOOD   0 /* Transport good, command good */

Definition at line 184 of file isd200.c.

#define REG_ALTERNATE_STATUS   0x01

Definition at line 143 of file isd200.c.

#define REG_COMMAND   0x80

Definition at line 153 of file isd200.c.

#define REG_CYLINDER_HIGH   0x20

Definition at line 150 of file isd200.c.

#define REG_CYLINDER_LOW   0x10

Definition at line 149 of file isd200.c.

#define REG_DEVICE_CONTROL   0x01

Definition at line 144 of file isd200.c.

#define REG_DEVICE_HEAD   0x40

Definition at line 151 of file isd200.c.

#define REG_ERROR   0x02

Definition at line 145 of file isd200.c.

#define REG_FEATURES   0x02

Definition at line 146 of file isd200.c.

#define REG_SECTOR_COUNT   0x04

Definition at line 147 of file isd200.c.

#define REG_SECTOR_NUMBER   0x08

Definition at line 148 of file isd200.c.

#define REG_STATUS   0x80

Definition at line 152 of file isd200.c.

#define SENSE_BUFFER_SIZE   18

Definition at line 393 of file isd200.c.

#define SENSE_ERRCODE   0x7f

Definition at line 370 of file isd200.c.

#define SENSE_ERRCODE_VALID   0x80

Definition at line 371 of file isd200.c.

#define SENSE_FLAG_BAD_LENGTH   0x20

Definition at line 373 of file isd200.c.

#define SENSE_FLAG_END_OF_MEDIA   0x40

Definition at line 374 of file isd200.c.

#define SENSE_FLAG_FILE_MARK   0x80

Definition at line 375 of file isd200.c.

#define SENSE_FLAG_SENSE_KEY   0x0f

Definition at line 372 of file isd200.c.

#define UNUSUAL_DEV (   id_vendor,
  id_product,
  bcdDeviceMin,
  bcdDeviceMax,
  vendorName,
  productName,
  useProtocol,
  useTransport,
  initFunction,
  flags 
)
Value:
{ USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
.driver_info = (flags) }

Definition at line 90 of file isd200.c.

#define UNUSUAL_DEV (   idVendor,
  idProduct,
  bcdDeviceMin,
  bcdDeviceMax,
  vendor_name,
  product_name,
  use_protocol,
  use_transport,
  init_function,
  Flags 
)
Value:
{ \
.vendorName = vendor_name, \
.productName = product_name, \
.useProtocol = use_protocol, \
.useTransport = use_transport, \
.initFunction = init_function, \
}

Definition at line 90 of file isd200.c.

Function Documentation

struct inquiry_data __attribute__ ( (packed)  )
read

mcontroller : adapter info structure for old mimd_t apps

: base address : irq number : number of logical drives : pci bus : pci device : pci function : pci id : vendor id : slot number : unique id

Definition at line 171 of file esd_usb2.c.

MODULE_AUTHOR ( "Björn Stenberg <[email protected]>"  )
MODULE_DESCRIPTION ( "Driver for In-System  Design,
Inc.ISD200 ASIC"   
)
MODULE_DEVICE_TABLE ( usb  ,
isd200_usb_ids   
)
MODULE_LICENSE ( "GPL"  )
module_usb_driver ( isd200_driver  )

Variable Documentation

unsigned char AdditionalLength

Definition at line 289 of file isd200.c.

unsigned char AdditionalSenseCode

Definition at line 394 of file isd200.c.

unsigned char AdditionalSenseCodeQualifier

Definition at line 395 of file isd200.c.

unsigned char AdditionalSenseLength

Definition at line 392 of file isd200.c.

unsigned char ATAConfig

Definition at line 324 of file isd200.c.

unsigned char ATAExtraConfig

Definition at line 327 of file isd200.c.

unsigned char ATAInitTimeout

Definition at line 323 of file isd200.c.

unsigned char ATAMajorCommand

Definition at line 325 of file isd200.c.

unsigned char ATAMinorCommand

Definition at line 326 of file isd200.c.

unsigned char Capability

Definition at line 291 of file isd200.c.

unsigned char CommandSpecificInformation[4]

Definition at line 393 of file isd200.c.

unsigned char DeviceType

Definition at line 285 of file isd200.c.

unsigned char DeviceTypeModifier

Definition at line 286 of file isd200.c.

unsigned char ErrorCode

Definition at line 388 of file isd200.c.

unsigned char EventNotification

Definition at line 321 of file isd200.c.

unsigned char ExternalClock

Definition at line 322 of file isd200.c.

unsigned char FieldReplaceableUnitCode

Definition at line 396 of file isd200.c.

unsigned char Flags

Definition at line 390 of file isd200.c.

unsigned char Format

Definition at line 288 of file isd200.c.

unsigned char Information[4]

Definition at line 391 of file isd200.c.

unsigned char ProductId[16]

Definition at line 293 of file isd200.c.

unsigned char ProductRevisionLevel[4]

Definition at line 294 of file isd200.c.

unsigned char Reserved[2]

Definition at line 290 of file isd200.c.

__u8 Reserved3

Definition at line 296 of file isd200.c.

unsigned char SegmentNumber

Definition at line 389 of file isd200.c.

unsigned char SenseKeySpecific[3]

Definition at line 397 of file isd200.c.

unsigned char VendorId[8]

Definition at line 292 of file isd200.c.

unsigned char VendorSpecific[20]

Definition at line 295 of file isd200.c.

unsigned char Versions

Definition at line 287 of file isd200.c.