Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
storvsc_drv.c File Reference
#include <linux/kernel.h>
#include <linux/wait.h>
#include <linux/sched.h>
#include <linux/completion.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/hyperv.h>
#include <linux/mempool.h>
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_tcq.h>
#include <scsi/scsi_eh.h>
#include <scsi/scsi_devinfo.h>
#include <scsi/scsi_dbg.h>

Go to the source code of this file.

Data Structures

struct  vmscsi_request
 
struct  vmstorage_channel_properties
 
struct  vmstorage_protocol_version
 
struct  vstor_packet
 
struct  storvsc_cmd_request
 
struct  storvsc_device
 
struct  stor_mem_pools
 
struct  hv_host_device
 
struct  storvsc_scan_work
 

Macros

#define VMSTOR_CURRENT_MAJOR   4
 
#define VMSTOR_CURRENT_MINOR   2
 
#define STORVSC_MAX_CMD_LEN   0x10
 
#define STORVSC_SENSE_BUFFER_SIZE   0x12
 
#define STORVSC_MAX_BUF_LEN_WITH_PADDING   0x14
 
#define STORAGE_CHANNEL_REMOVABLE_FLAG   0x1
 
#define STORAGE_CHANNEL_EMULATED_IDE_FLAG   0x2
 
#define REQUEST_COMPLETION_FLAG   0x1
 
#define SRB_STATUS_AUTOSENSE_VALID   0x80
 
#define SRB_STATUS_INVALID_LUN   0x20
 
#define SRB_STATUS_SUCCESS   0x01
 
#define SRB_STATUS_ERROR   0x04
 
#define STORVSC_MIN_BUF_NR   64
 
#define STORVSC_MAX_IO_REQUESTS   128
 
#define STORVSC_MAX_LUNS_PER_TARGET   64
 
#define STORVSC_MAX_TARGETS   1
 
#define STORVSC_MAX_CHANNELS   1
 

Enumerations

enum  vstor_packet_operation {
  VSTOR_OPERATION_COMPLETE_IO = 1, VSTOR_OPERATION_REMOVE_DEVICE = 2, VSTOR_OPERATION_EXECUTE_SRB = 3, VSTOR_OPERATION_RESET_LUN = 4,
  VSTOR_OPERATION_RESET_ADAPTER = 5, VSTOR_OPERATION_RESET_BUS = 6, VSTOR_OPERATION_BEGIN_INITIALIZATION = 7, VSTOR_OPERATION_END_INITIALIZATION = 8,
  VSTOR_OPERATION_QUERY_PROTOCOL_VERSION = 9, VSTOR_OPERATION_QUERY_PROPERTIES = 10, VSTOR_OPERATION_ENUMERATE_BUS = 11, VSTOR_OPERATION_MAXIMUM = 11
}
 
enum  storvsc_request_type { WRITE_TYPE = 0, READ_TYPE, UNKNOWN_TYPE }
 
enum  { SCSI_GUID, IDE_GUID }
 

Functions

struct vmscsi_request __attribute ((packed))
 
 module_param (storvsc_ringbuffer_size, int, S_IRUGO)
 
 MODULE_PARM_DESC (storvsc_ringbuffer_size,"Ring buffer size (bytes)")
 
 MODULE_DEVICE_TABLE (vmbus, id_table)
 
 MODULE_LICENSE ("GPL")
 
 MODULE_VERSION (HV_DRV_VERSION)
 
 MODULE_DESCRIPTION ("Microsoft Hyper-V virtual storage driver")
 
 module_init (storvsc_drv_init)
 
 module_exit (storvsc_drv_exit)
 

Variables

u16 length
 
u8 srb_status
 
u8 scsi_status
 
u8 port_number
 
u8 path_id
 
u8 target_id
 
u8 lun
 
u8 cdb_length
 
u8 sense_info_length
 
u8 data_in
 
u8 reserved
 
u32 data_transfer_length
 
union {
   u8   cdb [STORVSC_MAX_CMD_LEN]
 
   u8   sense_data [STORVSC_SENSE_BUFFER_SIZE]
 
   u8   reserved_array [STORVSC_MAX_BUF_LEN_WITH_PADDING]
 
}; 
 
struct vmstorage_channel_properties __packed
 

Macro Definition Documentation

#define REQUEST_COMPLETION_FLAG   0x1

Definition at line 188 of file storvsc_drv.c.

#define SRB_STATUS_AUTOSENSE_VALID   0x80

Definition at line 201 of file storvsc_drv.c.

#define SRB_STATUS_ERROR   0x04

Definition at line 204 of file storvsc_drv.c.

#define SRB_STATUS_INVALID_LUN   0x20

Definition at line 202 of file storvsc_drv.c.

#define SRB_STATUS_SUCCESS   0x01

Definition at line 203 of file storvsc_drv.c.

#define STORAGE_CHANNEL_EMULATED_IDE_FLAG   0x2

Definition at line 153 of file storvsc_drv.c.

#define STORAGE_CHANNEL_REMOVABLE_FLAG   0x1

Definition at line 152 of file storvsc_drv.c.

#define STORVSC_MAX_BUF_LEN_WITH_PADDING   0x14

Definition at line 87 of file storvsc_drv.c.

#define STORVSC_MAX_CHANNELS   1

Definition at line 233 of file storvsc_drv.c.

#define STORVSC_MAX_CMD_LEN   0x10

Definition at line 85 of file storvsc_drv.c.

#define STORVSC_MAX_IO_REQUESTS   128

Definition at line 223 of file storvsc_drv.c.

#define STORVSC_MAX_LUNS_PER_TARGET   64

Definition at line 231 of file storvsc_drv.c.

#define STORVSC_MAX_TARGETS   1

Definition at line 232 of file storvsc_drv.c.

#define STORVSC_MIN_BUF_NR   64

Definition at line 217 of file storvsc_drv.c.

#define STORVSC_SENSE_BUFFER_SIZE   0x12

Definition at line 86 of file storvsc_drv.c.

#define VMSTOR_CURRENT_MAJOR   4

Definition at line 60 of file storvsc_drv.c.

#define VMSTOR_CURRENT_MINOR   2

Definition at line 61 of file storvsc_drv.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
SCSI_GUID 
IDE_GUID 

Definition at line 1406 of file storvsc_drv.c.

Enumerator:
WRITE_TYPE 
READ_TYPE 
UNKNOWN_TYPE 

Definition at line 191 of file storvsc_drv.c.

Enumerator:
VSTOR_OPERATION_COMPLETE_IO 
VSTOR_OPERATION_REMOVE_DEVICE 
VSTOR_OPERATION_EXECUTE_SRB 
VSTOR_OPERATION_RESET_LUN 
VSTOR_OPERATION_RESET_ADAPTER 
VSTOR_OPERATION_RESET_BUS 
VSTOR_OPERATION_BEGIN_INITIALIZATION 
VSTOR_OPERATION_END_INITIALIZATION 
VSTOR_OPERATION_QUERY_PROTOCOL_VERSION 
VSTOR_OPERATION_QUERY_PROPERTIES 
VSTOR_OPERATION_ENUMERATE_BUS 
VSTOR_OPERATION_MAXIMUM 

Definition at line 65 of file storvsc_drv.c.

Function Documentation

struct vmscsi_request __attribute ( (packed)  )
MODULE_DESCRIPTION ( "Microsoft Hyper-V virtual storage driver )
MODULE_DEVICE_TABLE ( vmbus  ,
id_table   
)
module_exit ( storvsc_drv_exit  )
module_init ( storvsc_drv_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( storvsc_ringbuffer_size  ,
int  ,
S_IRUGO   
)
MODULE_PARM_DESC ( storvsc_ringbuffer_size  ,
"Ring buffer size (bytes)"   
)
MODULE_VERSION ( HV_DRV_VERSION  )

Variable Documentation

union { ... }

Definition at line 129 of file storvsc_drv.c.

u8 cdb_length

Definition at line 121 of file storvsc_drv.c.

u8 data_in

Definition at line 123 of file storvsc_drv.c.

u32 data_transfer_length

Definition at line 126 of file storvsc_drv.c.

u16 length

Definition at line 112 of file storvsc_drv.c.

u8 lun

Definition at line 119 of file storvsc_drv.c.

u8 path_id

Definition at line 117 of file storvsc_drv.c.

u8 port_number

Definition at line 116 of file storvsc_drv.c.

u8 reserved

Definition at line 124 of file storvsc_drv.c.

Definition at line 131 of file storvsc_drv.c.

u8 scsi_status

Definition at line 114 of file storvsc_drv.c.

Definition at line 130 of file storvsc_drv.c.

u8 sense_info_length

Definition at line 122 of file storvsc_drv.c.

u8 srb_status

Definition at line 113 of file storvsc_drv.c.

u8 target_id

Definition at line 118 of file storvsc_drv.c.