Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
mspro_block.c File Reference
#include <linux/blkdev.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>

Go to the source code of this file.

Data Structures

struct  mspro_sys_attr
 
struct  mspro_attr_entry
 
struct  mspro_attribute
 
struct  mspro_sys_info
 
struct  mspro_mbr
 
struct  mspro_specfile
 
struct  mspro_devinfo
 
struct  mspro_block_data
 

Macros

#define DRIVER_NAME   "mspro_block"
 
#define MSPRO_BLOCK_MAX_SEGS   32
 
#define MSPRO_BLOCK_MAX_PAGES   ((2 << 16) - 1)
 
#define MSPRO_BLOCK_SIGNATURE   0xa5c3
 
#define MSPRO_BLOCK_MAX_ATTRIBUTES   41
 
#define MSPRO_BLOCK_PART_SHIFT   3
 
#define mspro_block_suspend   NULL
 
#define mspro_block_resume   NULL
 

Typedefs

typedef ssize_t(* sysfs_show_t )(struct device *dev, struct device_attribute *attr, char *buffer)
 

Enumerations

enum  {
  MSPRO_BLOCK_ID_SYSINFO = 0x10, MSPRO_BLOCK_ID_MODELNAME = 0x15, MSPRO_BLOCK_ID_MBR = 0x20, MSPRO_BLOCK_ID_PBR16 = 0x21,
  MSPRO_BLOCK_ID_PBR32 = 0x22, MSPRO_BLOCK_ID_SPECFILEVALUES1 = 0x25, MSPRO_BLOCK_ID_SPECFILEVALUES2 = 0x26, MSPRO_BLOCK_ID_DEVINFO = 0x30
}
 

Functions

 module_param (major, int, 0644)
 
struct mspro_attr_entry __attribute__ ((packed))
 
 module_init (mspro_block_init)
 
 module_exit (mspro_block_exit)
 
 MODULE_LICENSE ("GPL")
 
 MODULE_AUTHOR ("Alex Dubov")
 
 MODULE_DESCRIPTION ("Sony MemoryStickPro block device driver")
 
 MODULE_DEVICE_TABLE (memstick, mspro_block_id_tbl)
 

Variables

__be32 address
 
__be32 size
 
unsigned char id
 
unsigned char reserved [3]
 
__be16 signature
 
unsigned short version
 
unsigned char count
 
struct mspro_attr_entry entries []
 
unsigned char reserved0
 
__be16 block_size
 
__be16 block_count
 
__be16 user_block_count
 
__be16 page_size
 
unsigned char reserved1 [2]
 
unsigned char assembly_date [8]
 
__be32 serial_number
 
unsigned char assembly_maker_code
 
unsigned char assembly_model_code [3]
 
__be16 memory_maker_code
 
__be16 memory_model_code
 
unsigned char reserved2 [4]
 
unsigned char vcc
 
unsigned char vpp
 
__be16 controller_number
 
__be16 controller_function
 
__be16 start_sector
 
__be16 unit_size
 
unsigned char ms_sub_class
 
unsigned char reserved3 [4]
 
unsigned char interface_type
 
__be16 controller_code
 
unsigned char format_type
 
unsigned char reserved4
 
unsigned char device_type
 
unsigned char reserved5 [7]
 
unsigned char mspro_id [16]
 
unsigned char reserved6 [16]
 
unsigned char boot_partition
 
unsigned char start_head
 
unsigned char start_cylinder
 
unsigned char partition_type
 
unsigned char end_head
 
unsigned char end_sector
 
unsigned char end_cylinder
 
unsigned int start_sectors
 
unsigned int sectors_per_partition
 
char name [8]
 
char ext [3]
 
unsigned char attr
 
unsigned short time
 
unsigned short date
 
unsigned short cluster
 
__be16 cylinders
 
__be16 heads
 
__be16 bytes_per_track
 
__be16 bytes_per_sector
 
__be16 sectors_per_track
 
struct mspro_block_data __attribute__
 
: pointer to a string for the name of this class.

class_create - create a struct class structure : pointer to the module that is to "own" this struct class

: the lock_class_key for this class; used by mutex lock debugging

This is used to create a struct class pointer that can then be used in calls to device_create().

Returns &struct class pointer on success, or ERR_PTR() on error.

Note, the pointer created here is to be destroyed when finished by making a call to class_destroy().

unsigned char class
 

Macro Definition Documentation

#define DRIVER_NAME   "mspro_block"

Definition at line 25 of file mspro_block.c.

#define MSPRO_BLOCK_MAX_ATTRIBUTES   41

Definition at line 34 of file mspro_block.c.

#define MSPRO_BLOCK_MAX_PAGES   ((2 << 16) - 1)

Definition at line 31 of file mspro_block.c.

#define MSPRO_BLOCK_MAX_SEGS   32

Definition at line 30 of file mspro_block.c.

#define MSPRO_BLOCK_PART_SHIFT   3

Definition at line 36 of file mspro_block.c.

#define mspro_block_resume   NULL

Definition at line 1445 of file mspro_block.c.

#define MSPRO_BLOCK_SIGNATURE   0xa5c3

Definition at line 33 of file mspro_block.c.

#define mspro_block_suspend   NULL

Definition at line 1444 of file mspro_block.c.

Typedef Documentation

typedef ssize_t(* sysfs_show_t)(struct device *dev, struct device_attribute *attr, char *buffer)

Definition at line 288 of file mspro_block.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
MSPRO_BLOCK_ID_SYSINFO 
MSPRO_BLOCK_ID_MODELNAME 
MSPRO_BLOCK_ID_MBR 
MSPRO_BLOCK_ID_PBR16 
MSPRO_BLOCK_ID_PBR32 
MSPRO_BLOCK_ID_SPECFILEVALUES1 
MSPRO_BLOCK_ID_SPECFILEVALUES2 
MSPRO_BLOCK_ID_DEVINFO 

Definition at line 38 of file mspro_block.c.

Function Documentation

struct mspro_attr_entry __attribute__ ( (packed)  )
read

Definition at line 171 of file esd_usb2.c.

MODULE_AUTHOR ( "Alex Dubov"  )
MODULE_DESCRIPTION ( "Sony MemoryStickPro block device driver )
MODULE_DEVICE_TABLE ( memstick  ,
mspro_block_id_tbl   
)
module_exit ( mspro_block_exit  )
module_init ( mspro_block_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( major  ,
int  ,
0644   
)

Variable Documentation

Definition at line 63 of file mspro_block.c.

unsigned char assembly_date[8]

Definition at line 111 of file mspro_block.c.

unsigned char assembly_maker_code

Definition at line 113 of file mspro_block.c.

unsigned char assembly_model_code[3]

Definition at line 114 of file mspro_block.c.

__le16 attr

Definition at line 130 of file mspro_block.c.

__be16 block_count

Definition at line 107 of file mspro_block.c.

__be16 block_size

Definition at line 106 of file mspro_block.c.

unsigned char boot_partition

Definition at line 117 of file mspro_block.c.

__be16 bytes_per_sector

Definition at line 140 of file mspro_block.c.

__be16 bytes_per_track

Definition at line 139 of file mspro_block.c.

code. There's no locking restriction.

Definition at line 104 of file mspro_block.c.

unsigned short cluster

Definition at line 134 of file mspro_block.c.

__be16 controller_code

Definition at line 127 of file mspro_block.c.

__be16 controller_function

Definition at line 121 of file mspro_block.c.

__be16 controller_number

Definition at line 120 of file mspro_block.c.

unsigned char count

Definition at line 73 of file mspro_block.c.

__be16 cylinders

Definition at line 137 of file mspro_block.c.

unsigned short date

Definition at line 133 of file mspro_block.c.

unsigned char device_type

Definition at line 130 of file mspro_block.c.

unsigned char end_cylinder

Definition at line 124 of file mspro_block.c.

unsigned char end_head

Definition at line 122 of file mspro_block.c.

unsigned char end_sector

Definition at line 123 of file mspro_block.c.

Definition at line 75 of file mspro_block.c.

char ext[3]

Definition at line 129 of file mspro_block.c.

unsigned char format_type

Definition at line 128 of file mspro_block.c.

__be16 heads

Definition at line 138 of file mspro_block.c.

unsigned char id

Definition at line 65 of file mspro_block.c.

unsigned char interface_type

Definition at line 126 of file mspro_block.c.

__be16 memory_maker_code

Definition at line 115 of file mspro_block.c.

__be16 memory_model_code

Definition at line 116 of file mspro_block.c.

unsigned char ms_sub_class

Definition at line 124 of file mspro_block.c.

unsigned char mspro_id[16]

Definition at line 132 of file mspro_block.c.

char name[8]

Definition at line 128 of file mspro_block.c.

__be16 page_size

Definition at line 109 of file mspro_block.c.

unsigned char partition_type

Definition at line 121 of file mspro_block.c.

unsigned char reserved[6]

Definition at line 66 of file mspro_block.c.

unsigned char reserved0

Definition at line 105 of file mspro_block.c.

unsigned char reserved1[2]

Definition at line 110 of file mspro_block.c.

unsigned char reserved2[4]

Definition at line 117 of file mspro_block.c.

unsigned char reserved3[4]

Definition at line 125 of file mspro_block.c.

unsigned char reserved4

Definition at line 129 of file mspro_block.c.

unsigned char reserved5[7]

Definition at line 131 of file mspro_block.c.

unsigned char reserved6[16]

Definition at line 133 of file mspro_block.c.

unsigned int sectors_per_partition

Definition at line 126 of file mspro_block.c.

__be16 sectors_per_track

Definition at line 141 of file mspro_block.c.

__be32 serial_number

Definition at line 112 of file mspro_block.c.

__be16 signature

Definition at line 71 of file mspro_block.c.

unsigned int size

Definition at line 64 of file mspro_block.c.

unsigned char start_cylinder

Definition at line 120 of file mspro_block.c.

unsigned char start_head

Definition at line 118 of file mspro_block.c.

unsigned char start_sector

Definition at line 122 of file mspro_block.c.

unsigned int start_sectors

Definition at line 125 of file mspro_block.c.

unsigned short time

Definition at line 132 of file mspro_block.c.

__be16 unit_size

Definition at line 123 of file mspro_block.c.

__be16 user_block_count

Definition at line 108 of file mspro_block.c.

unsigned char vcc

Definition at line 118 of file mspro_block.c.

unsigned short version

Definition at line 72 of file mspro_block.c.

unsigned char vpp

Definition at line 119 of file mspro_block.c.