Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
sbp2.c File Reference
#include <linux/blkdev.h>
#include <linux/bug.h>
#include <linux/completion.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/dma-mapping.h>
#include <linux/firewire.h>
#include <linux/firewire-constants.h>
#include <linux/init.h>
#include <linux/jiffies.h>
#include <linux/kernel.h>
#include <linux/kref.h>
#include <linux/list.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/scatterlist.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/string.h>
#include <linux/stringify.h>
#include <linux/workqueue.h>
#include <asm/byteorder.h>
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_host.h>

Go to the source code of this file.

Data Structures

struct  sbp2_logical_unit
 
struct  sbp2_target
 
struct  sbp2_status
 
struct  sbp2_pointer
 
struct  sbp2_orb
 
struct  sbp2_management_orb
 
struct  sbp2_login_response
 
struct  sbp2_command_orb
 

Macros

#define SBP2_WORKAROUND_128K_MAX_TRANS   0x1
 
#define SBP2_WORKAROUND_INQUIRY_36   0x2
 
#define SBP2_WORKAROUND_MODE_SENSE_8   0x4
 
#define SBP2_WORKAROUND_FIX_CAPACITY   0x8
 
#define SBP2_WORKAROUND_DELAY_INQUIRY   0x10
 
#define SBP2_INQUIRY_DELAY   12
 
#define SBP2_WORKAROUND_POWER_CONDITION   0x20
 
#define SBP2_WORKAROUND_OVERRIDE   0x100
 
#define INVALID_LOGIN_ID   0x10000
 
#define SBP2_ORB_TIMEOUT   2000U /* Timeout in ms */
 
#define SBP2_ORB_NULL   0x80000000
 
#define SBP2_RETRY_LIMIT   0xf /* 15 retries */
 
#define SBP2_CYCLE_LIMIT   (0xc8 << 12) /* 200 125us cycles */
 
#define SBP2_MAX_CDB_SIZE   16
 
#define SBP2_MAX_SEG_SIZE   0xfffc
 
#define SBP2_CSR_UNIT_CHARACTERISTICS   0x3a
 
#define SBP2_CSR_FIRMWARE_REVISION   0x3c
 
#define SBP2_CSR_LOGICAL_UNIT_NUMBER   0x14
 
#define SBP2_CSR_UNIT_UNIQUE_ID   0x8d
 
#define SBP2_CSR_LOGICAL_UNIT_DIRECTORY   0xd4
 
#define SBP2_LOGIN_REQUEST   0x0
 
#define SBP2_QUERY_LOGINS_REQUEST   0x1
 
#define SBP2_RECONNECT_REQUEST   0x3
 
#define SBP2_SET_PASSWORD_REQUEST   0x4
 
#define SBP2_LOGOUT_REQUEST   0x7
 
#define SBP2_ABORT_TASK_REQUEST   0xb
 
#define SBP2_ABORT_TASK_SET   0xc
 
#define SBP2_LOGICAL_UNIT_RESET   0xe
 
#define SBP2_TARGET_RESET_REQUEST   0xf
 
#define SBP2_AGENT_STATE   0x00
 
#define SBP2_AGENT_RESET   0x04
 
#define SBP2_ORB_POINTER   0x08
 
#define SBP2_DOORBELL   0x10
 
#define SBP2_UNSOLICITED_STATUS_ENABLE   0x14
 
#define SBP2_STATUS_REQUEST_COMPLETE   0x0
 
#define SBP2_STATUS_TRANSPORT_FAILURE   0x1
 
#define SBP2_STATUS_ILLEGAL_REQUEST   0x2
 
#define SBP2_STATUS_VENDOR_DEPENDENT   0x3
 
#define STATUS_GET_ORB_HIGH(v)   ((v).status & 0xffff)
 
#define STATUS_GET_SBP_STATUS(v)   (((v).status >> 16) & 0xff)
 
#define STATUS_GET_LEN(v)   (((v).status >> 24) & 0x07)
 
#define STATUS_GET_DEAD(v)   (((v).status >> 27) & 0x01)
 
#define STATUS_GET_RESPONSE(v)   (((v).status >> 28) & 0x03)
 
#define STATUS_GET_SOURCE(v)   (((v).status >> 30) & 0x03)
 
#define STATUS_GET_ORB_LOW(v)   ((v).orb_low)
 
#define STATUS_GET_DATA(v)   ((v).data)
 
#define MANAGEMENT_ORB_LUN(v)   ((v))
 
#define MANAGEMENT_ORB_FUNCTION(v)   ((v) << 16)
 
#define MANAGEMENT_ORB_RECONNECT(v)   ((v) << 20)
 
#define MANAGEMENT_ORB_EXCLUSIVE(v)   ((v) ? 1 << 28 : 0)
 
#define MANAGEMENT_ORB_REQUEST_FORMAT(v)   ((v) << 29)
 
#define MANAGEMENT_ORB_NOTIFY   ((1) << 31)
 
#define MANAGEMENT_ORB_RESPONSE_LENGTH(v)   ((v))
 
#define MANAGEMENT_ORB_PASSWORD_LENGTH(v)   ((v) << 16)
 
#define COMMAND_ORB_DATA_SIZE(v)   ((v))
 
#define COMMAND_ORB_PAGE_SIZE(v)   ((v) << 16)
 
#define COMMAND_ORB_PAGE_TABLE_PRESENT   ((1) << 19)
 
#define COMMAND_ORB_MAX_PAYLOAD(v)   ((v) << 20)
 
#define COMMAND_ORB_SPEED(v)   ((v) << 24)
 
#define COMMAND_ORB_DIRECTION   ((1) << 27)
 
#define COMMAND_ORB_REQUEST_FORMAT(v)   ((v) << 29)
 
#define COMMAND_ORB_NOTIFY   ((1) << 31)
 
#define SBP2_ROM_VALUE_WILDCARD   ~0 /* match all */
 
#define SBP2_ROM_VALUE_MISSING   0xff000000 /* not present in the unit dir. */
 
#define SBP2_UNIT_SPEC_ID_ENTRY   0x0000609e
 
#define SBP2_SW_VERSION_ENTRY   0x00010483
 

Functions

 module_param_named (exclusive_login, sbp2_param_exclusive_login, bool, 0644)
 
 MODULE_PARM_DESC (exclusive_login,"Exclusive login to sbp2 device ""(default = Y, use N for concurrent initiators)")
 
 module_param_named (workarounds, sbp2_param_workarounds, int, 0644)
 
 MODULE_PARM_DESC (workarounds,"Work around device bugs (default = 0"", 128kB max transfer = "__stringify(SBP2_WORKAROUND_128K_MAX_TRANS)", 36 byte inquiry = "__stringify(SBP2_WORKAROUND_INQUIRY_36)", skip mode page 8 = "__stringify(SBP2_WORKAROUND_MODE_SENSE_8)", fix capacity = "__stringify(SBP2_WORKAROUND_FIX_CAPACITY)", delay inquiry = "__stringify(SBP2_WORKAROUND_DELAY_INQUIRY)", set power condition in start stop unit = "__stringify(SBP2_WORKAROUND_POWER_CONDITION)", override internal blacklist = "__stringify(SBP2_WORKAROUND_OVERRIDE)", or a combination)")
 
 MODULE_AUTHOR ("Kristian Hoegsberg <[email protected]>")
 
 MODULE_DESCRIPTION ("SCSI over IEEE1394")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_DEVICE_TABLE (ieee1394, sbp2_id_table)
 
 MODULE_ALIAS ("sbp2")
 
 module_init (sbp2_init)
 
 module_exit (sbp2_cleanup)
 

Macro Definition Documentation

#define COMMAND_ORB_DATA_SIZE (   v)    ((v))

Definition at line 305 of file sbp2.c.

#define COMMAND_ORB_DIRECTION   ((1) << 27)

Definition at line 310 of file sbp2.c.

#define COMMAND_ORB_MAX_PAYLOAD (   v)    ((v) << 20)

Definition at line 308 of file sbp2.c.

#define COMMAND_ORB_NOTIFY   ((1) << 31)

Definition at line 312 of file sbp2.c.

#define COMMAND_ORB_PAGE_SIZE (   v)    ((v) << 16)

Definition at line 306 of file sbp2.c.

#define COMMAND_ORB_PAGE_TABLE_PRESENT   ((1) << 19)

Definition at line 307 of file sbp2.c.

#define COMMAND_ORB_REQUEST_FORMAT (   v)    ((v) << 29)

Definition at line 311 of file sbp2.c.

#define COMMAND_ORB_SPEED (   v)    ((v) << 24)

Definition at line 309 of file sbp2.c.

#define INVALID_LOGIN_ID   0x10000

Definition at line 196 of file sbp2.c.

#define MANAGEMENT_ORB_EXCLUSIVE (   v)    ((v) ? 1 << 28 : 0)

Definition at line 278 of file sbp2.c.

#define MANAGEMENT_ORB_FUNCTION (   v)    ((v) << 16)

Definition at line 276 of file sbp2.c.

#define MANAGEMENT_ORB_LUN (   v)    ((v))

Definition at line 275 of file sbp2.c.

#define MANAGEMENT_ORB_NOTIFY   ((1) << 31)

Definition at line 280 of file sbp2.c.

#define MANAGEMENT_ORB_PASSWORD_LENGTH (   v)    ((v) << 16)

Definition at line 283 of file sbp2.c.

#define MANAGEMENT_ORB_RECONNECT (   v)    ((v) << 20)

Definition at line 277 of file sbp2.c.

#define MANAGEMENT_ORB_REQUEST_FORMAT (   v)    ((v) << 29)

Definition at line 279 of file sbp2.c.

#define MANAGEMENT_ORB_RESPONSE_LENGTH (   v)    ((v))

Definition at line 282 of file sbp2.c.

#define SBP2_ABORT_TASK_REQUEST   0xb

Definition at line 228 of file sbp2.c.

#define SBP2_ABORT_TASK_SET   0xc

Definition at line 229 of file sbp2.c.

#define SBP2_AGENT_RESET   0x04

Definition at line 235 of file sbp2.c.

#define SBP2_AGENT_STATE   0x00

Definition at line 234 of file sbp2.c.

#define SBP2_CSR_FIRMWARE_REVISION   0x3c

Definition at line 217 of file sbp2.c.

#define SBP2_CSR_LOGICAL_UNIT_DIRECTORY   0xd4

Definition at line 220 of file sbp2.c.

#define SBP2_CSR_LOGICAL_UNIT_NUMBER   0x14

Definition at line 218 of file sbp2.c.

#define SBP2_CSR_UNIT_CHARACTERISTICS   0x3a

Definition at line 216 of file sbp2.c.

#define SBP2_CSR_UNIT_UNIQUE_ID   0x8d

Definition at line 219 of file sbp2.c.

#define SBP2_CYCLE_LIMIT   (0xc8 << 12) /* 200 125us cycles */

Definition at line 201 of file sbp2.c.

#define SBP2_DOORBELL   0x10

Definition at line 237 of file sbp2.c.

#define SBP2_INQUIRY_DELAY   12

Definition at line 110 of file sbp2.c.

#define SBP2_LOGICAL_UNIT_RESET   0xe

Definition at line 230 of file sbp2.c.

#define SBP2_LOGIN_REQUEST   0x0

Definition at line 223 of file sbp2.c.

#define SBP2_LOGOUT_REQUEST   0x7

Definition at line 227 of file sbp2.c.

#define SBP2_MAX_CDB_SIZE   16

Definition at line 207 of file sbp2.c.

#define SBP2_MAX_SEG_SIZE   0xfffc

Definition at line 213 of file sbp2.c.

#define SBP2_ORB_NULL   0x80000000

Definition at line 199 of file sbp2.c.

#define SBP2_ORB_POINTER   0x08

Definition at line 236 of file sbp2.c.

#define SBP2_ORB_TIMEOUT   2000U /* Timeout in ms */

Definition at line 198 of file sbp2.c.

#define SBP2_QUERY_LOGINS_REQUEST   0x1

Definition at line 224 of file sbp2.c.

#define SBP2_RECONNECT_REQUEST   0x3

Definition at line 225 of file sbp2.c.

#define SBP2_RETRY_LIMIT   0xf /* 15 retries */

Definition at line 200 of file sbp2.c.

#define SBP2_ROM_VALUE_MISSING   0xff000000 /* not present in the unit dir. */

Definition at line 330 of file sbp2.c.

#define SBP2_ROM_VALUE_WILDCARD   ~0 /* match all */

Definition at line 329 of file sbp2.c.

#define SBP2_SET_PASSWORD_REQUEST   0x4

Definition at line 226 of file sbp2.c.

#define SBP2_STATUS_ILLEGAL_REQUEST   0x2

Definition at line 243 of file sbp2.c.

#define SBP2_STATUS_REQUEST_COMPLETE   0x0

Definition at line 241 of file sbp2.c.

#define SBP2_STATUS_TRANSPORT_FAILURE   0x1

Definition at line 242 of file sbp2.c.

#define SBP2_STATUS_VENDOR_DEPENDENT   0x3

Definition at line 244 of file sbp2.c.

#define SBP2_SW_VERSION_ENTRY   0x00010483

Definition at line 1271 of file sbp2.c.

#define SBP2_TARGET_RESET_REQUEST   0xf

Definition at line 231 of file sbp2.c.

#define SBP2_UNIT_SPEC_ID_ENTRY   0x0000609e

Definition at line 1270 of file sbp2.c.

#define SBP2_UNSOLICITED_STATUS_ENABLE   0x14

Definition at line 238 of file sbp2.c.

#define SBP2_WORKAROUND_128K_MAX_TRANS   0x1

Definition at line 105 of file sbp2.c.

#define SBP2_WORKAROUND_DELAY_INQUIRY   0x10

Definition at line 109 of file sbp2.c.

#define SBP2_WORKAROUND_FIX_CAPACITY   0x8

Definition at line 108 of file sbp2.c.

#define SBP2_WORKAROUND_INQUIRY_36   0x2

Definition at line 106 of file sbp2.c.

#define SBP2_WORKAROUND_MODE_SENSE_8   0x4

Definition at line 107 of file sbp2.c.

#define SBP2_WORKAROUND_OVERRIDE   0x100

Definition at line 112 of file sbp2.c.

#define SBP2_WORKAROUND_POWER_CONDITION   0x20

Definition at line 111 of file sbp2.c.

#define STATUS_GET_DATA (   v)    ((v).data)

Definition at line 253 of file sbp2.c.

#define STATUS_GET_DEAD (   v)    (((v).status >> 27) & 0x01)

Definition at line 249 of file sbp2.c.

#define STATUS_GET_LEN (   v)    (((v).status >> 24) & 0x07)

Definition at line 248 of file sbp2.c.

#define STATUS_GET_ORB_HIGH (   v)    ((v).status & 0xffff)

Definition at line 246 of file sbp2.c.

#define STATUS_GET_ORB_LOW (   v)    ((v).orb_low)

Definition at line 252 of file sbp2.c.

#define STATUS_GET_RESPONSE (   v)    (((v).status >> 28) & 0x03)

Definition at line 250 of file sbp2.c.

#define STATUS_GET_SBP_STATUS (   v)    (((v).status >> 16) & 0xff)

Definition at line 247 of file sbp2.c.

#define STATUS_GET_SOURCE (   v)    (((v).status >> 30) & 0x03)

Definition at line 251 of file sbp2.c.

Function Documentation

MODULE_ALIAS ( "sbp2"  )
MODULE_AUTHOR ( "Kristian Hoegsberg <[email protected]>"  )
MODULE_DESCRIPTION ( "SCSI over IEEE1394"  )
MODULE_DEVICE_TABLE ( ieee1394  ,
sbp2_id_table   
)
module_exit ( sbp2_cleanup  )
module_init ( sbp2_init  )
MODULE_LICENSE ( "GPL"  )
module_param_named ( exclusive_login  ,
sbp2_param_exclusive_login  ,
bool  ,
0644   
)
module_param_named ( workarounds  ,
sbp2_param_workarounds  ,
int  ,
0644   
)
MODULE_PARM_DESC ( exclusive_login  ,
"Exclusive login to sbp2 device ""(default = Y, use N for concurrent initiators)"   
)
MODULE_PARM_DESC ( workarounds  ,
"Work around device bugs (default = 0"", 128kB max transfer = "__stringify(SBP2_WORKAROUND_128K_MAX_TRANS)", 36 byte inquiry = "__stringify(SBP2_WORKAROUND_INQUIRY_36)", skip mode page 8 = "__stringify(SBP2_WORKAROUND_MODE_SENSE_8)", fix capacity = "__stringify(SBP2_WORKAROUND_FIX_CAPACITY)", delay inquiry = "__stringify(SBP2_WORKAROUND_DELAY_INQUIRY)", set power condition in start stop unit = "__stringify(SBP2_WORKAROUND_POWER_CONDITION)", override internal blacklist = "__stringify(SBP2_WORKAROUND_OVERRIDE)", or a combination)"   
)

Variable Documentation

u32 firmware_revision

Definition at line 341 of file sbp2.c.

u32 model

Definition at line 342 of file sbp2.c.

unsigned int workarounds

Definition at line 343 of file sbp2.c.