Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
ms.h File Reference
#include "rts51x_chip.h"

Go to the source code of this file.

Macros

#define MS_MAX_RETRY_COUNT   3
 
#define MS_EXTRA_SIZE   0x9
 
#define WRT_PRTCT   0x01
 
#define MS_NO_ERROR   0x00
 
#define MS_CRC16_ERROR   0x80
 
#define MS_TO_ERROR   0x40
 
#define MS_NO_CARD   0x20
 
#define MS_NO_MEMORY   0x10
 
#define MS_CMD_NK   0x08
 
#define MS_FLASH_READ_ERROR   0x04
 
#define MS_FLASH_WRITE_ERROR   0x02
 
#define MS_BREQ_ERROR   0x01
 
#define MS_NOT_FOUND   0x03
 
#define READ_PAGE_DATA   0x02
 
#define READ_REG   0x04
 
#define GET_INT   0x07
 
#define WRITE_PAGE_DATA   0x0D
 
#define WRITE_REG   0x0B
 
#define SET_RW_REG_ADRS   0x08
 
#define SET_CMD   0x0E
 
#define PRO_READ_LONG_DATA   0x02
 
#define PRO_READ_SHORT_DATA   0x03
 
#define PRO_READ_REG   0x04
 
#define PRO_READ_QUAD_DATA   0x05
 
#define PRO_GET_INT   0x07
 
#define PRO_WRITE_LONG_DATA   0x0D
 
#define PRO_WRITE_SHORT_DATA   0x0C
 
#define PRO_WRITE_QUAD_DATA   0x0A
 
#define PRO_WRITE_REG   0x0B
 
#define PRO_SET_RW_REG_ADRS   0x08
 
#define PRO_SET_CMD   0x0E
 
#define PRO_EX_SET_CMD   0x09
 
#define MG_GET_ID   0x40
 
#define MG_SET_LID   0x41
 
#define MG_GET_LEKB   0x42
 
#define MG_SET_RD   0x43
 
#define MG_MAKE_RMS   0x44
 
#define MG_MAKE_KSE   0x45
 
#define MG_SET_IBD   0x46
 
#define MG_GET_IBD   0x47
 
#define XC_CHG_POWER   0x16
 
#define BLOCK_READ   0xAA
 
#define BLOCK_WRITE   0x55
 
#define BLOCK_END   0x33
 
#define BLOCK_ERASE   0x99
 
#define FLASH_STOP   0xCC
 
#define SLEEP   0x5A
 
#define CLEAR_BUF   0xC3
 
#define MS_RESET   0x3C
 
#define PRO_READ_DATA   0x20
 
#define PRO_WRITE_DATA   0x21
 
#define PRO_READ_ATRB   0x24
 
#define PRO_STOP   0x25
 
#define PRO_ERASE   0x26
 
#define PRO_READ_2K_DATA   0x27
 
#define PRO_WRITE_2K_DATA   0x28
 
#define PRO_FORMAT   0x10
 
#define PRO_SLEEP   0x11
 
#define IntReg   0x01
 
#define StatusReg0   0x02
 
#define StatusReg1   0x03
 
#define SystemParm   0x10
 
#define BlockAdrs   0x11
 
#define CMDParm   0x14
 
#define PageAdrs   0x15
 
#define OverwriteFlag   0x16
 
#define ManagemenFlag   0x17
 
#define LogicalAdrs   0x18
 
#define ReserveArea   0x1A
 
#define Pro_IntReg   0x01
 
#define Pro_StatusReg   0x02
 
#define Pro_TypeReg   0x04
 
#define Pro_IFModeReg   0x05
 
#define Pro_CatagoryReg   0x06
 
#define Pro_ClassReg   0x07
 
#define Pro_SystemParm   0x10
 
#define Pro_DataCount1   0x11
 
#define Pro_DataCount0   0x12
 
#define Pro_DataAddr3   0x13
 
#define Pro_DataAddr2   0x14
 
#define Pro_DataAddr1   0x15
 
#define Pro_DataAddr0   0x16
 
#define Pro_TPCParm   0x17
 
#define Pro_CMDParm   0x18
 
#define INT_REG_CED   0x80
 
#define INT_REG_ERR   0x40
 
#define INT_REG_BREQ   0x20
 
#define INT_REG_CMDNK   0x01
 
#define INT_CED   0x01
 
#define INT_ERR   0x02
 
#define INT_BREQ   0x04
 
#define INT_CMDNK   0x08
 
#define BLOCK_BOOT   0xC0
 
#define BLOCK_OK   0x80
 
#define PAGE_OK   0x60
 
#define DATA_COMPL   0x10
 
#define NOT_BOOT_BLOCK   0x4
 
#define NOT_TRANSLATION_TABLE   0x8
 
#define HEADER_ID0   (PPBUF_BASE2) /* 0 */
 
#define HEADER_ID1   (PPBUF_BASE2 + 1) /* 1 */
 
#define DISABLED_BLOCK0   (PPBUF_BASE2 + 0x170 + 4) /* 2 */
 
#define DISABLED_BLOCK1   (PPBUF_BASE2 + 0x170 + 5) /* 3 */
 
#define DISABLED_BLOCK2   (PPBUF_BASE2 + 0x170 + 6) /* 4 */
 
#define DISABLED_BLOCK3   (PPBUF_BASE2 + 0x170 + 7) /* 5 */
 
#define BLOCK_SIZE_0   (PPBUF_BASE2 + 0x1a0 + 2) /* 6 */
 
#define BLOCK_SIZE_1   (PPBUF_BASE2 + 0x1a0 + 3) /* 7 */
 
#define BLOCK_COUNT_0   (PPBUF_BASE2 + 0x1a0 + 4) /* 8 */
 
#define BLOCK_COUNT_1   (PPBUF_BASE2 + 0x1a0 + 5) /* 9 */
 
#define EBLOCK_COUNT_0   (PPBUF_BASE2 + 0x1a0 + 6) /* 10 */
 
#define EBLOCK_COUNT_1   (PPBUF_BASE2 + 0x1a0 + 7) /* 11 */
 
#define PAGE_SIZE_0   (PPBUF_BASE2 + 0x1a0 + 8) /* 12 */
 
#define PAGE_SIZE_1   (PPBUF_BASE2 + 0x1a0 + 9) /* 13 */
 
#define MS_Device_Type   (PPBUF_BASE2 + 0x1D8) /* 14 */
 
#define MS_4bit_Support   (PPBUF_BASE2 + 0x1D3) /* 15 */
 
#define setPS_NG   1
 
#define setPS_Error   0
 
#define PARALLEL_8BIT_IF   0x40
 
#define PARALLEL_4BIT_IF   0x00
 
#define SERIAL_IF   0x80
 
#define BUF_FULL   0x10
 
#define BUF_EMPTY   0x20
 
#define MEDIA_BUSY   0x80
 
#define FLASH_BUSY   0x40
 
#define DATA_ERROR   0x20
 
#define STS_UCDT   0x10
 
#define EXTRA_ERROR   0x08
 
#define STS_UCEX   0x04
 
#define FLAG_ERROR   0x02
 
#define STS_UCFG   0x01
 
#define MS_SHORT_DATA_LEN   32
 
#define FORMAT_SUCCESS   0
 
#define FORMAT_FAIL   1
 
#define FORMAT_IN_PROGRESS   2
 
#define MS_SET_BAD_BLOCK_FLG(ms_card)   ((ms_card)->multi_flag |= 0x80)
 
#define MS_CLR_BAD_BLOCK_FLG(ms_card)   ((ms_card)->multi_flag &= 0x7F)
 
#define MS_TST_BAD_BLOCK_FLG(ms_card)   ((ms_card)->multi_flag & 0x80)
 
#define CHECK_MS_TRANS_FAIL(chip, retval)
 

Functions

void mspro_polling_format_status (struct rts51x_chip *chip)
 
void mspro_format_sense (struct rts51x_chip *chip, unsigned int lun)
 
int reset_ms_card (struct rts51x_chip *chip)
 
int ms_rw (struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector, u16 sector_cnt)
 
int mspro_format (struct scsi_cmnd *srb, struct rts51x_chip *chip, int short_data_len, int quick_format)
 
void ms_free_l2p_tbl (struct rts51x_chip *chip)
 
void ms_cleanup_work (struct rts51x_chip *chip)
 
int release_ms_card (struct rts51x_chip *chip)
 
int ms_delay_write (struct rts51x_chip *chip)
 
int ms_switch_clock (struct rts51x_chip *chip)
 
int ms_write_bytes (struct rts51x_chip *chip, u8 tpc, u8 cnt, u8 cfg, u8 *data, int data_len)
 
int ms_read_bytes (struct rts51x_chip *chip, u8 tpc, u8 cnt, u8 cfg, u8 *data, int data_len)
 
int ms_set_rw_reg_addr (struct rts51x_chip *chip, u8 read_start, u8 read_cnt, u8 write_start, u8 write_cnt)
 
int ms_transfer_data (struct rts51x_chip *chip, u8 trans_mode, u8 tpc, u16 sec_cnt, u8 cfg, int mode_2k, int use_sg, void *buf, int buf_len)
 

Macro Definition Documentation

#define BLOCK_BOOT   0xC0

Definition at line 163 of file ms.h.

#define BLOCK_COUNT_0   (PPBUF_BASE2 + 0x1a0 + 4) /* 8 */

Definition at line 183 of file ms.h.

#define BLOCK_COUNT_1   (PPBUF_BASE2 + 0x1a0 + 5) /* 9 */

Definition at line 184 of file ms.h.

#define BLOCK_END   0x33

Definition at line 91 of file ms.h.

#define BLOCK_ERASE   0x99

Definition at line 92 of file ms.h.

#define BLOCK_OK   0x80

Definition at line 164 of file ms.h.

#define BLOCK_READ   0xAA

Definition at line 89 of file ms.h.

#define BLOCK_SIZE_0   (PPBUF_BASE2 + 0x1a0 + 2) /* 6 */

Definition at line 181 of file ms.h.

#define BLOCK_SIZE_1   (PPBUF_BASE2 + 0x1a0 + 3) /* 7 */

Definition at line 182 of file ms.h.

#define BLOCK_WRITE   0x55

Definition at line 90 of file ms.h.

#define BlockAdrs   0x11

Definition at line 122 of file ms.h.

#define BUF_EMPTY   0x20

Definition at line 208 of file ms.h.

#define BUF_FULL   0x10

Definition at line 207 of file ms.h.

#define CHECK_MS_TRANS_FAIL (   chip,
  retval 
)
Value:
(((retval) != STATUS_SUCCESS) || \
(chip->rsp_buf[0] & MS_TRANSFER_ERR))

Definition at line 230 of file ms.h.

#define CLEAR_BUF   0xC3

Definition at line 97 of file ms.h.

#define CMDParm   0x14

Definition at line 123 of file ms.h.

#define DATA_COMPL   0x10

Definition at line 166 of file ms.h.

#define DATA_ERROR   0x20

Definition at line 213 of file ms.h.

#define DISABLED_BLOCK0   (PPBUF_BASE2 + 0x170 + 4) /* 2 */

Definition at line 176 of file ms.h.

#define DISABLED_BLOCK1   (PPBUF_BASE2 + 0x170 + 5) /* 3 */

Definition at line 177 of file ms.h.

#define DISABLED_BLOCK2   (PPBUF_BASE2 + 0x170 + 6) /* 4 */

Definition at line 178 of file ms.h.

#define DISABLED_BLOCK3   (PPBUF_BASE2 + 0x170 + 7) /* 5 */

Definition at line 179 of file ms.h.

#define EBLOCK_COUNT_0   (PPBUF_BASE2 + 0x1a0 + 6) /* 10 */

Definition at line 185 of file ms.h.

#define EBLOCK_COUNT_1   (PPBUF_BASE2 + 0x1a0 + 7) /* 11 */

Definition at line 186 of file ms.h.

#define EXTRA_ERROR   0x08

Definition at line 215 of file ms.h.

#define FLAG_ERROR   0x02

Definition at line 217 of file ms.h.

#define FLASH_BUSY   0x40

Definition at line 212 of file ms.h.

#define FLASH_STOP   0xCC

Definition at line 93 of file ms.h.

#define FORMAT_FAIL   1

Definition at line 223 of file ms.h.

#define FORMAT_IN_PROGRESS   2

Definition at line 224 of file ms.h.

#define FORMAT_SUCCESS   0

Definition at line 222 of file ms.h.

#define GET_INT   0x07

Definition at line 53 of file ms.h.

#define HEADER_ID0   (PPBUF_BASE2) /* 0 */

Definition at line 173 of file ms.h.

#define HEADER_ID1   (PPBUF_BASE2 + 1) /* 1 */

Definition at line 174 of file ms.h.

#define INT_BREQ   0x04

Definition at line 159 of file ms.h.

#define INT_CED   0x01

Definition at line 157 of file ms.h.

#define INT_CMDNK   0x08

Definition at line 160 of file ms.h.

#define INT_ERR   0x02

Definition at line 158 of file ms.h.

#define INT_REG_BREQ   0x20

Definition at line 153 of file ms.h.

#define INT_REG_CED   0x80

Definition at line 151 of file ms.h.

#define INT_REG_CMDNK   0x01

Definition at line 154 of file ms.h.

#define INT_REG_ERR   0x40

Definition at line 152 of file ms.h.

#define IntReg   0x01

Definition at line 117 of file ms.h.

#define LogicalAdrs   0x18

Definition at line 128 of file ms.h.

#define ManagemenFlag   0x17

Definition at line 127 of file ms.h.

#define MEDIA_BUSY   0x80

Definition at line 211 of file ms.h.

#define MG_GET_IBD   0x47

Definition at line 80 of file ms.h.

#define MG_GET_ID   0x40

Definition at line 73 of file ms.h.

#define MG_GET_LEKB   0x42

Definition at line 75 of file ms.h.

#define MG_MAKE_KSE   0x45

Definition at line 78 of file ms.h.

#define MG_MAKE_RMS   0x44

Definition at line 77 of file ms.h.

#define MG_SET_IBD   0x46

Definition at line 79 of file ms.h.

#define MG_SET_LID   0x41

Definition at line 74 of file ms.h.

#define MG_SET_RD   0x43

Definition at line 76 of file ms.h.

#define MS_4bit_Support   (PPBUF_BASE2 + 0x1D3) /* 15 */

Definition at line 195 of file ms.h.

#define MS_BREQ_ERROR   0x01

Definition at line 47 of file ms.h.

#define MS_CLR_BAD_BLOCK_FLG (   ms_card)    ((ms_card)->multi_flag &= 0x7F)

Definition at line 227 of file ms.h.

#define MS_CMD_NK   0x08

Definition at line 44 of file ms.h.

#define MS_CRC16_ERROR   0x80

Definition at line 40 of file ms.h.

#define MS_Device_Type   (PPBUF_BASE2 + 0x1D8) /* 14 */

Definition at line 191 of file ms.h.

#define MS_EXTRA_SIZE   0x9

Definition at line 34 of file ms.h.

#define MS_FLASH_READ_ERROR   0x04

Definition at line 45 of file ms.h.

#define MS_FLASH_WRITE_ERROR   0x02

Definition at line 46 of file ms.h.

#define MS_MAX_RETRY_COUNT   3

Definition at line 32 of file ms.h.

#define MS_NO_CARD   0x20

Definition at line 42 of file ms.h.

#define MS_NO_ERROR   0x00

Definition at line 39 of file ms.h.

#define MS_NO_MEMORY   0x10

Definition at line 43 of file ms.h.

#define MS_NOT_FOUND   0x03

Definition at line 48 of file ms.h.

#define MS_RESET   0x3C

Definition at line 98 of file ms.h.

#define MS_SET_BAD_BLOCK_FLG (   ms_card)    ((ms_card)->multi_flag |= 0x80)

Definition at line 226 of file ms.h.

#define MS_SHORT_DATA_LEN   32

Definition at line 220 of file ms.h.

#define MS_TO_ERROR   0x40

Definition at line 41 of file ms.h.

#define MS_TST_BAD_BLOCK_FLG (   ms_card)    ((ms_card)->multi_flag & 0x80)

Definition at line 228 of file ms.h.

#define NOT_BOOT_BLOCK   0x4

Definition at line 169 of file ms.h.

#define NOT_TRANSLATION_TABLE   0x8

Definition at line 170 of file ms.h.

#define OverwriteFlag   0x16

Definition at line 126 of file ms.h.

#define PAGE_OK   0x60

Definition at line 165 of file ms.h.

#define PAGE_SIZE_0   (PPBUF_BASE2 + 0x1a0 + 8) /* 12 */

Definition at line 187 of file ms.h.

#define PAGE_SIZE_1   (PPBUF_BASE2 + 0x1a0 + 9) /* 13 */

Definition at line 188 of file ms.h.

#define PageAdrs   0x15

Definition at line 124 of file ms.h.

#define PARALLEL_4BIT_IF   0x00

Definition at line 203 of file ms.h.

#define PARALLEL_8BIT_IF   0x40

Definition at line 202 of file ms.h.

#define Pro_CatagoryReg   0x06

Definition at line 136 of file ms.h.

#define Pro_ClassReg   0x07

Definition at line 137 of file ms.h.

#define Pro_CMDParm   0x18

Definition at line 148 of file ms.h.

#define Pro_DataAddr0   0x16

Definition at line 145 of file ms.h.

#define Pro_DataAddr1   0x15

Definition at line 144 of file ms.h.

#define Pro_DataAddr2   0x14

Definition at line 143 of file ms.h.

#define Pro_DataAddr3   0x13

Definition at line 142 of file ms.h.

#define Pro_DataCount0   0x12

Definition at line 141 of file ms.h.

#define Pro_DataCount1   0x11

Definition at line 140 of file ms.h.

#define PRO_ERASE   0x26

Definition at line 107 of file ms.h.

#define PRO_EX_SET_CMD   0x09

Definition at line 70 of file ms.h.

#define PRO_FORMAT   0x10

Definition at line 112 of file ms.h.

#define PRO_GET_INT   0x07

Definition at line 63 of file ms.h.

#define Pro_IFModeReg   0x05

Definition at line 135 of file ms.h.

#define Pro_IntReg   0x01

Definition at line 132 of file ms.h.

#define PRO_READ_2K_DATA   0x27

Definition at line 108 of file ms.h.

#define PRO_READ_ATRB   0x24

Definition at line 105 of file ms.h.

#define PRO_READ_DATA   0x20

Definition at line 103 of file ms.h.

#define PRO_READ_LONG_DATA   0x02

Definition at line 59 of file ms.h.

#define PRO_READ_QUAD_DATA   0x05

Definition at line 62 of file ms.h.

#define PRO_READ_REG   0x04

Definition at line 61 of file ms.h.

#define PRO_READ_SHORT_DATA   0x03

Definition at line 60 of file ms.h.

#define PRO_SET_CMD   0x0E

Definition at line 69 of file ms.h.

#define PRO_SET_RW_REG_ADRS   0x08

Definition at line 68 of file ms.h.

#define PRO_SLEEP   0x11

Definition at line 113 of file ms.h.

#define Pro_StatusReg   0x02

Definition at line 133 of file ms.h.

#define PRO_STOP   0x25

Definition at line 106 of file ms.h.

#define Pro_SystemParm   0x10

Definition at line 139 of file ms.h.

#define Pro_TPCParm   0x17

Definition at line 147 of file ms.h.

#define Pro_TypeReg   0x04

Definition at line 134 of file ms.h.

#define PRO_WRITE_2K_DATA   0x28

Definition at line 109 of file ms.h.

#define PRO_WRITE_DATA   0x21

Definition at line 104 of file ms.h.

#define PRO_WRITE_LONG_DATA   0x0D

Definition at line 64 of file ms.h.

#define PRO_WRITE_QUAD_DATA   0x0A

Definition at line 66 of file ms.h.

#define PRO_WRITE_REG   0x0B

Definition at line 67 of file ms.h.

#define PRO_WRITE_SHORT_DATA   0x0C

Definition at line 65 of file ms.h.

#define READ_PAGE_DATA   0x02

Definition at line 51 of file ms.h.

#define READ_REG   0x04

Definition at line 52 of file ms.h.

#define ReserveArea   0x1A

Definition at line 129 of file ms.h.

#define SERIAL_IF   0x80

Definition at line 204 of file ms.h.

#define SET_CMD   0x0E

Definition at line 57 of file ms.h.

#define SET_RW_REG_ADRS   0x08

Definition at line 56 of file ms.h.

#define setPS_Error   0

Definition at line 199 of file ms.h.

#define setPS_NG   1

Definition at line 198 of file ms.h.

#define SLEEP   0x5A

Definition at line 96 of file ms.h.

#define StatusReg0   0x02

Definition at line 118 of file ms.h.

#define StatusReg1   0x03

Definition at line 119 of file ms.h.

#define STS_UCDT   0x10

Definition at line 214 of file ms.h.

#define STS_UCEX   0x04

Definition at line 216 of file ms.h.

#define STS_UCFG   0x01

Definition at line 218 of file ms.h.

#define SystemParm   0x10

Definition at line 121 of file ms.h.

#define WRITE_PAGE_DATA   0x0D

Definition at line 54 of file ms.h.

#define WRITE_REG   0x0B

Definition at line 55 of file ms.h.

#define WRT_PRTCT   0x01

Definition at line 36 of file ms.h.

#define XC_CHG_POWER   0x16

Definition at line 84 of file ms.h.

Function Documentation

void ms_cleanup_work ( struct rts51x_chip chip)

Definition at line 4113 of file ms.c.

int ms_delay_write ( struct rts51x_chip chip)

Definition at line 3806 of file ms.c.

void ms_free_l2p_tbl ( struct rts51x_chip chip)

Definition at line 4092 of file ms.c.

int ms_read_bytes ( struct rts51x_chip chip,
u8  tpc,
u8  cnt,
u8  cfg,
u8 data,
int  data_len 
)

Definition at line 269 of file ms.c.

int ms_rw ( struct scsi_cmnd srb,
struct rts51x_chip chip,
u32  start_sector,
u16  sector_cnt 
)

Definition at line 4076 of file ms.c.

int ms_set_rw_reg_addr ( struct rts51x_chip chip,
u8  read_start,
u8  read_cnt,
u8  write_start,
u8  write_cnt 
)

Definition at line 345 of file ms.c.

int ms_switch_clock ( struct rts51x_chip chip)

Definition at line 516 of file ms.c.

int ms_transfer_data ( struct rts51x_chip chip,
u8  trans_mode,
u8  tpc,
u16  sec_cnt,
u8  cfg,
int  mode_2k,
int  use_sg,
void buf,
int  buf_len 
)

Definition at line 118 of file ms.c.

int ms_write_bytes ( struct rts51x_chip chip,
u8  tpc,
u8  cnt,
u8  cfg,
u8 data,
int  data_len 
)

Definition at line 197 of file ms.c.

int mspro_format ( struct scsi_cmnd srb,
struct rts51x_chip chip,
int  short_data_len,
int  quick_format 
)

Definition at line 2973 of file ms.c.

void mspro_format_sense ( struct rts51x_chip chip,
unsigned int  lun 
)

Definition at line 2955 of file ms.c.

void mspro_polling_format_status ( struct rts51x_chip chip)

Definition at line 2939 of file ms.c.

int release_ms_card ( struct rts51x_chip chip)

Definition at line 4164 of file ms.c.

int reset_ms_card ( struct rts51x_chip chip)

Definition at line 2603 of file ms.c.