Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
xd.h File Reference

Go to the source code of this file.

Macros

#define XD_NO_ERROR   0x00
 
#define XD_NO_MEMORY   0x80
 
#define XD_PRG_ERROR   0x40
 
#define XD_NO_CARD   0x20
 
#define XD_READ_FAIL   0x10
 
#define XD_ERASE_FAIL   0x08
 
#define XD_WRITE_FAIL   0x04
 
#define XD_ECC_ERROR   0x02
 
#define XD_TO_ERROR   0x01
 
#define READ1_1   0x00
 
#define READ1_2   0x01
 
#define READ2   0x50
 
#define READ_ID   0x90
 
#define RESET   0xff
 
#define PAGE_PRG_1   0x80
 
#define PAGE_PRG_2   0x10
 
#define BLK_ERASE_1   0x60
 
#define BLK_ERASE_2   0xD0
 
#define READ_STS   0x70
 
#define READ_xD_ID   0x9A
 
#define COPY_BACK_512   0x8A
 
#define COPY_BACK_2K   0x85
 
#define READ1_1_2   0x30
 
#define READ1_1_3   0x35
 
#define CHG_DAT_OUT_1   0x05
 
#define RDM_DAT_OUT_1   0x05
 
#define CHG_DAT_OUT_2   0xE0
 
#define RDM_DAT_OUT_2   0xE0
 
#define CHG_DAT_OUT_2   0xE0
 
#define CHG_DAT_IN_1   0x85
 
#define CACHE_PRG   0x15
 
#define XD_EXTRA_SIZE   0x10
 
#define XD_2K_EXTRA_SIZE   0x40
 
#define NOT_WRITE_PROTECTED   0x80
 
#define READY_STATE   0x40
 
#define PROGRAM_ERROR   0x01
 
#define PROGRAM_ERROR_N_1   0x02
 
#define INTERNAL_READY   0x20
 
#define READY_FLAG   0x5F
 
#define XD_8M_X8_512   0xE6
 
#define XD_16M_X8_512   0x73
 
#define XD_32M_X8_512   0x75
 
#define XD_64M_X8_512   0x76
 
#define XD_128M_X8_512   0x79
 
#define XD_256M_X8_512   0x71
 
#define XD_128M_X8_2048   0xF1
 
#define XD_256M_X8_2048   0xDA
 
#define XD_512M_X8   0xDC
 
#define XD_128M_X16_2048   0xC1
 
#define XD_4M_X8_512_1   0xE3
 
#define XD_4M_X8_512_2   0xE5
 
#define xD_1G_X8_512   0xD3
 
#define xD_2G_X8_512   0xD5
 
#define XD_ID_CODE   0xB5
 
#define VENDOR_BLOCK   0xEFFF
 
#define CIS_BLOCK   0xDFFF
 
#define BLK_NOT_FOUND   0xFFFFFFFF
 
#define NO_NEW_BLK   0xFFFFFFFF
 
#define PAGE_CORRECTABLE   0x0
 
#define PAGE_NOTCORRECTABLE   0x1
 
#define NO_OFFSET   0x0
 
#define WITH_OFFSET   0x1
 
#define Sect_Per_Page   4
 
#define XD_ADDR_MODE_2C   XD_ADDR_MODE_2A
 
#define ZONE0_BAD_BLOCK   23
 
#define NOT_ZONE0_BAD_BLOCK   24
 
#define XD_RW_ADDR   0x01
 
#define XD_ERASE_ADDR   0x02
 
#define XD_PAGE_512(xd_card)
 
#define XD_SET_BAD_NEWBLK(xd_card)   ((xd_card)->multi_flag |= 0x01)
 
#define XD_CLR_BAD_NEWBLK(xd_card)   ((xd_card)->multi_flag &= ~0x01)
 
#define XD_CHK_BAD_NEWBLK(xd_card)   ((xd_card)->multi_flag & 0x01)
 
#define XD_SET_BAD_OLDBLK(xd_card)   ((xd_card)->multi_flag |= 0x02)
 
#define XD_CLR_BAD_OLDBLK(xd_card)   ((xd_card)->multi_flag &= ~0x02)
 
#define XD_CHK_BAD_OLDBLK(xd_card)   ((xd_card)->multi_flag & 0x02)
 
#define XD_SET_MBR_FAIL(xd_card)   ((xd_card)->multi_flag |= 0x04)
 
#define XD_CLR_MBR_FAIL(xd_card)   ((xd_card)->multi_flag &= ~0x04)
 
#define XD_CHK_MBR_FAIL(xd_card)   ((xd_card)->multi_flag & 0x04)
 
#define XD_SET_ECC_FLD_ERR(xd_card)   ((xd_card)->multi_flag |= 0x08)
 
#define XD_CLR_ECC_FLD_ERR(xd_card)   ((xd_card)->multi_flag &= ~0x08)
 
#define XD_CHK_ECC_FLD_ERR(xd_card)   ((xd_card)->multi_flag & 0x08)
 
#define XD_SET_4MB(xd_card)   ((xd_card)->multi_flag |= 0x10)
 
#define XD_CLR_4MB(xd_card)   ((xd_card)->multi_flag &= ~0x10)
 
#define XD_CHK_4MB(xd_card)   ((xd_card)->multi_flag & 0x10)
 
#define XD_SET_ECC_ERR(xd_card)   ((xd_card)->multi_flag |= 0x40)
 
#define XD_CLR_ECC_ERR(xd_card)   ((xd_card)->multi_flag &= ~0x40)
 
#define XD_CHK_ECC_ERR(xd_card)   ((xd_card)->multi_flag & 0x40)
 
#define PAGE_STATUS   0
 
#define BLOCK_STATUS   1
 
#define BLOCK_ADDR1_L   2
 
#define BLOCK_ADDR1_H   3
 
#define BLOCK_ADDR2_L   4
 
#define BLOCK_ADDR2_H   5
 
#define RESERVED0   6
 
#define RESERVED1   7
 
#define RESERVED2   8
 
#define RESERVED3   9
 
#define PARITY   10
 
#define CIS0_0   0
 
#define CIS0_1   1
 
#define CIS0_2   2
 
#define CIS0_3   3
 
#define CIS0_4   4
 
#define CIS0_5   5
 
#define CIS0_6   6
 
#define CIS0_7   7
 
#define CIS0_8   8
 
#define CIS0_9   9
 
#define CIS1_0   256
 
#define CIS1_1   (256 + 1)
 
#define CIS1_2   (256 + 2)
 
#define CIS1_3   (256 + 3)
 
#define CIS1_4   (256 + 4)
 
#define CIS1_5   (256 + 5)
 
#define CIS1_6   (256 + 6)
 
#define CIS1_7   (256 + 7)
 
#define CIS1_8   (256 + 8)
 
#define CIS1_9   (256 + 9)
 

Functions

int reset_xd_card (struct rts51x_chip *chip)
 
int xd_rw (struct scsi_cmnd *srb, struct rts51x_chip *chip, u32 start_sector, u16 sector_cnt)
 
void xd_free_l2p_tbl (struct rts51x_chip *chip)
 
void xd_cleanup_work (struct rts51x_chip *chip)
 
int release_xd_card (struct rts51x_chip *chip)
 

Macro Definition Documentation

#define BLK_ERASE_1   0x60

Definition at line 49 of file xd.h.

#define BLK_ERASE_2   0xD0

Definition at line 50 of file xd.h.

#define BLK_NOT_FOUND   0xFFFFFFFF

Definition at line 98 of file xd.h.

#define BLOCK_ADDR1_H   3

Definition at line 153 of file xd.h.

#define BLOCK_ADDR1_L   2

Definition at line 152 of file xd.h.

#define BLOCK_ADDR2_H   5

Definition at line 155 of file xd.h.

#define BLOCK_ADDR2_L   4

Definition at line 154 of file xd.h.

#define BLOCK_STATUS   1

Definition at line 151 of file xd.h.

#define CACHE_PRG   0x15

Definition at line 63 of file xd.h.

#define CHG_DAT_IN_1   0x85

Definition at line 62 of file xd.h.

#define CHG_DAT_OUT_1   0x05

Definition at line 57 of file xd.h.

#define CHG_DAT_OUT_2   0xE0

Definition at line 61 of file xd.h.

#define CHG_DAT_OUT_2   0xE0

Definition at line 61 of file xd.h.

#define CIS0_0   0

Definition at line 163 of file xd.h.

#define CIS0_1   1

Definition at line 164 of file xd.h.

#define CIS0_2   2

Definition at line 165 of file xd.h.

#define CIS0_3   3

Definition at line 166 of file xd.h.

#define CIS0_4   4

Definition at line 167 of file xd.h.

#define CIS0_5   5

Definition at line 168 of file xd.h.

#define CIS0_6   6

Definition at line 169 of file xd.h.

#define CIS0_7   7

Definition at line 170 of file xd.h.

#define CIS0_8   8

Definition at line 171 of file xd.h.

#define CIS0_9   9

Definition at line 172 of file xd.h.

#define CIS1_0   256

Definition at line 173 of file xd.h.

#define CIS1_1   (256 + 1)

Definition at line 174 of file xd.h.

#define CIS1_2   (256 + 2)

Definition at line 175 of file xd.h.

#define CIS1_3   (256 + 3)

Definition at line 176 of file xd.h.

#define CIS1_4   (256 + 4)

Definition at line 177 of file xd.h.

#define CIS1_5   (256 + 5)

Definition at line 178 of file xd.h.

#define CIS1_6   (256 + 6)

Definition at line 179 of file xd.h.

#define CIS1_7   (256 + 7)

Definition at line 180 of file xd.h.

#define CIS1_8   (256 + 8)

Definition at line 181 of file xd.h.

#define CIS1_9   (256 + 9)

Definition at line 182 of file xd.h.

#define CIS_BLOCK   0xDFFF

Definition at line 96 of file xd.h.

#define COPY_BACK_2K   0x85

Definition at line 54 of file xd.h.

#define COPY_BACK_512   0x8A

Definition at line 53 of file xd.h.

#define INTERNAL_READY   0x20

Definition at line 74 of file xd.h.

#define NO_NEW_BLK   0xFFFFFFFF

Definition at line 100 of file xd.h.

#define NO_OFFSET   0x0

Definition at line 105 of file xd.h.

#define NOT_WRITE_PROTECTED   0x80

Definition at line 70 of file xd.h.

#define NOT_ZONE0_BAD_BLOCK   24

Definition at line 112 of file xd.h.

#define PAGE_CORRECTABLE   0x0

Definition at line 102 of file xd.h.

#define PAGE_NOTCORRECTABLE   0x1

Definition at line 103 of file xd.h.

#define PAGE_PRG_1   0x80

Definition at line 47 of file xd.h.

#define PAGE_PRG_2   0x10

Definition at line 48 of file xd.h.

#define PAGE_STATUS   0

Definition at line 150 of file xd.h.

#define PARITY   10

Definition at line 160 of file xd.h.

#define PROGRAM_ERROR   0x01

Definition at line 72 of file xd.h.

#define PROGRAM_ERROR_N_1   0x02

Definition at line 73 of file xd.h.

#define RDM_DAT_OUT_1   0x05

Definition at line 58 of file xd.h.

#define RDM_DAT_OUT_2   0xE0

Definition at line 60 of file xd.h.

#define READ1_1   0x00

Definition at line 42 of file xd.h.

#define READ1_1_2   0x30

Definition at line 55 of file xd.h.

#define READ1_1_3   0x35

Definition at line 56 of file xd.h.

#define READ1_2   0x01

Definition at line 43 of file xd.h.

#define READ2   0x50

Definition at line 44 of file xd.h.

#define READ_ID   0x90

Definition at line 45 of file xd.h.

#define READ_STS   0x70

Definition at line 51 of file xd.h.

#define READ_xD_ID   0x9A

Definition at line 52 of file xd.h.

#define READY_FLAG   0x5F

Definition at line 75 of file xd.h.

#define READY_STATE   0x40

Definition at line 71 of file xd.h.

#define RESERVED0   6

Definition at line 156 of file xd.h.

#define RESERVED1   7

Definition at line 157 of file xd.h.

#define RESERVED2   8

Definition at line 158 of file xd.h.

#define RESERVED3   9

Definition at line 159 of file xd.h.

#define RESET   0xff

Definition at line 46 of file xd.h.

#define Sect_Per_Page   4

Definition at line 108 of file xd.h.

#define VENDOR_BLOCK   0xEFFF

Definition at line 95 of file xd.h.

#define WITH_OFFSET   0x1

Definition at line 106 of file xd.h.

#define XD_128M_X16_2048   0xC1

Definition at line 87 of file xd.h.

#define XD_128M_X8_2048   0xF1

Definition at line 84 of file xd.h.

#define XD_128M_X8_512   0x79

Definition at line 82 of file xd.h.

#define XD_16M_X8_512   0x73

Definition at line 79 of file xd.h.

#define xD_1G_X8_512   0xD3

Definition at line 90 of file xd.h.

#define XD_256M_X8_2048   0xDA

Definition at line 85 of file xd.h.

#define XD_256M_X8_512   0x71

Definition at line 83 of file xd.h.

#define xD_2G_X8_512   0xD5

Definition at line 91 of file xd.h.

#define XD_2K_EXTRA_SIZE   0x40

Definition at line 67 of file xd.h.

#define XD_32M_X8_512   0x75

Definition at line 80 of file xd.h.

#define XD_4M_X8_512_1   0xE3

Definition at line 88 of file xd.h.

#define XD_4M_X8_512_2   0xE5

Definition at line 89 of file xd.h.

#define XD_512M_X8   0xDC

Definition at line 86 of file xd.h.

#define XD_64M_X8_512   0x76

Definition at line 81 of file xd.h.

#define XD_8M_X8_512   0xE6

Definition at line 78 of file xd.h.

#define XD_ADDR_MODE_2C   XD_ADDR_MODE_2A

Definition at line 109 of file xd.h.

#define XD_CHK_4MB (   xd_card)    ((xd_card)->multi_flag & 0x10)

Definition at line 143 of file xd.h.

#define XD_CHK_BAD_NEWBLK (   xd_card)    ((xd_card)->multi_flag & 0x01)

Definition at line 127 of file xd.h.

#define XD_CHK_BAD_OLDBLK (   xd_card)    ((xd_card)->multi_flag & 0x02)

Definition at line 131 of file xd.h.

#define XD_CHK_ECC_ERR (   xd_card)    ((xd_card)->multi_flag & 0x40)

Definition at line 147 of file xd.h.

#define XD_CHK_ECC_FLD_ERR (   xd_card)    ((xd_card)->multi_flag & 0x08)

Definition at line 139 of file xd.h.

#define XD_CHK_MBR_FAIL (   xd_card)    ((xd_card)->multi_flag & 0x04)

Definition at line 135 of file xd.h.

#define XD_CLR_4MB (   xd_card)    ((xd_card)->multi_flag &= ~0x10)

Definition at line 142 of file xd.h.

#define XD_CLR_BAD_NEWBLK (   xd_card)    ((xd_card)->multi_flag &= ~0x01)

Definition at line 126 of file xd.h.

#define XD_CLR_BAD_OLDBLK (   xd_card)    ((xd_card)->multi_flag &= ~0x02)

Definition at line 130 of file xd.h.

#define XD_CLR_ECC_ERR (   xd_card)    ((xd_card)->multi_flag &= ~0x40)

Definition at line 146 of file xd.h.

#define XD_CLR_ECC_FLD_ERR (   xd_card)    ((xd_card)->multi_flag &= ~0x08)

Definition at line 138 of file xd.h.

#define XD_CLR_MBR_FAIL (   xd_card)    ((xd_card)->multi_flag &= ~0x04)

Definition at line 134 of file xd.h.

#define XD_ECC_ERROR   0x02

Definition at line 38 of file xd.h.

#define XD_ERASE_ADDR   0x02

Definition at line 116 of file xd.h.

#define XD_ERASE_FAIL   0x08

Definition at line 36 of file xd.h.

#define XD_EXTRA_SIZE   0x10

Definition at line 66 of file xd.h.

#define XD_ID_CODE   0xB5

Definition at line 93 of file xd.h.

#define XD_NO_CARD   0x20

Definition at line 34 of file xd.h.

#define XD_NO_ERROR   0x00

Definition at line 31 of file xd.h.

#define XD_NO_MEMORY   0x80

Definition at line 32 of file xd.h.

#define XD_PAGE_512 (   xd_card)
Value:
do { \
(xd_card)->block_shift = 5; \
(xd_card)->page_off = 0x1F; \
} while (0)

Definition at line 119 of file xd.h.

#define XD_PRG_ERROR   0x40

Definition at line 33 of file xd.h.

#define XD_READ_FAIL   0x10

Definition at line 35 of file xd.h.

#define XD_RW_ADDR   0x01

Definition at line 115 of file xd.h.

#define XD_SET_4MB (   xd_card)    ((xd_card)->multi_flag |= 0x10)

Definition at line 141 of file xd.h.

#define XD_SET_BAD_NEWBLK (   xd_card)    ((xd_card)->multi_flag |= 0x01)

Definition at line 125 of file xd.h.

#define XD_SET_BAD_OLDBLK (   xd_card)    ((xd_card)->multi_flag |= 0x02)

Definition at line 129 of file xd.h.

#define XD_SET_ECC_ERR (   xd_card)    ((xd_card)->multi_flag |= 0x40)

Definition at line 145 of file xd.h.

#define XD_SET_ECC_FLD_ERR (   xd_card)    ((xd_card)->multi_flag |= 0x08)

Definition at line 137 of file xd.h.

#define XD_SET_MBR_FAIL (   xd_card)    ((xd_card)->multi_flag |= 0x04)

Definition at line 133 of file xd.h.

#define XD_TO_ERROR   0x01

Definition at line 39 of file xd.h.

#define XD_WRITE_FAIL   0x04

Definition at line 37 of file xd.h.

#define ZONE0_BAD_BLOCK   23

Definition at line 111 of file xd.h.

Function Documentation

int release_xd_card ( struct rts51x_chip chip)

Definition at line 2118 of file xd.c.

int reset_xd_card ( struct rts51x_chip chip)

Definition at line 908 of file xd.c.

void xd_cleanup_work ( struct rts51x_chip chip)

Definition at line 2078 of file xd.c.

void xd_free_l2p_tbl ( struct rts51x_chip chip)

Definition at line 2057 of file xd.c.

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

Definition at line 1845 of file xd.c.