Changeset View
Standalone View
sys/dev/mmc/mmcreg.h
Show First 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | |||||
#define R5_IO_CURRENT_STATE_MASK (3u << 12) /* s, b */ | #define R5_IO_CURRENT_STATE_MASK (3u << 12) /* s, b */ | ||||
#define R5_IO_CURRENT_STATE(x) (((x) & R5_IO_CURRENT_STATE_MASK) >> 12) | #define R5_IO_CURRENT_STATE(x) (((x) & R5_IO_CURRENT_STATE_MASK) >> 12) | ||||
#define R5_ERROR (1u << 11) /* erx, c */ | #define R5_ERROR (1u << 11) /* erx, c */ | ||||
#define R5_FUNCTION_NUMBER (1u << 9) /* er, c */ | #define R5_FUNCTION_NUMBER (1u << 9) /* er, c */ | ||||
#define R5_OUT_OF_RANGE (1u << 8) /* er, c */ | #define R5_OUT_OF_RANGE (1u << 8) /* er, c */ | ||||
struct mmc_data { | struct mmc_data { | ||||
size_t len; /* size of the data */ | size_t len; /* size of the data */ | ||||
size_t block_size; /* block size for CMD53 */ | |||||
size_t block_count; /* block count for CMD53 */ | |||||
imp: It looks like if we add these to the end, we don't break binary compat...
But does camcontrol… | |||||
Done Inline ActionsWell, if you don't zero those fields when passing structure to the kernel, these fields end up being filled with the random garbage, and this changes the behavior of the SDHC driver because now it thinks that the upper layer requested the custom block size. kibab: Well, if you don't zero those fields when passing structure to the kernel, these fields end up… | |||||
Done Inline ActionsBut we bzero the CCB, which is larger than mmc_data so it won't be garbage... imp: But we bzero the CCB, which is larger than mmc_data so it won't be garbage...
And you could… | |||||
Done Inline ActionsCCB contains struct mmc_command and mmc_command contains a _pointer_ to mmc_data, not the actual mmc_data. So it will be garbaged unless initialized properly. kibab: CCB contains struct mmc_command and mmc_command contains a _pointer_ to mmc_data, not the… | |||||
size_t xfer_len; | size_t xfer_len; | ||||
void *data; /* data buffer */ | void *data; /* data buffer */ | ||||
uint32_t flags; | uint32_t flags; | ||||
#define MMC_DATA_WRITE (1UL << 0) | #define MMC_DATA_WRITE (1UL << 0) | ||||
#define MMC_DATA_READ (1UL << 1) | #define MMC_DATA_READ (1UL << 1) | ||||
#define MMC_DATA_STREAM (1UL << 2) | #define MMC_DATA_STREAM (1UL << 2) | ||||
#define MMC_DATA_MULTI (1UL << 3) | #define MMC_DATA_MULTI (1UL << 3) | ||||
#define MMC_DATA_BLOCK_SIZE (1UL << 4) | |||||
Done Inline Actionsso you have this flag, but don't use it. imp: so you have this flag, but don't use it.
And you've not moved the new elements to the end. | |||||
Done Inline ActionsCurrently there is no driver that can use this flag. mmc_da is not one of them. Moving elements -- ack. kibab: Currently there is no driver that can use this flag. mmc_da is not one of them.
Moving… | |||||
struct mmc_request *mrq; | struct mmc_request *mrq; | ||||
}; | }; | ||||
struct mmc_request { | struct mmc_request { | ||||
struct mmc_command *cmd; | struct mmc_command *cmd; | ||||
struct mmc_command *stop; | struct mmc_command *stop; | ||||
void (*done)(struct mmc_request *); /* Completion function */ | void (*done)(struct mmc_request *); /* Completion function */ | ||||
void *done_data; /* requestor set data */ | void *done_data; /* requestor set data */ | ||||
▲ Show 20 Lines • Show All 355 Lines • ▼ Show 20 Lines | |||||
#define SD_IO_CCCR_CARDCAP 0x08 | #define SD_IO_CCCR_CARDCAP 0x08 | ||||
#define SD_IO_CCCR_CISPTR 0x09 /* XXX 9-10, 10-11, or 9-12 */ | #define SD_IO_CCCR_CISPTR 0x09 /* XXX 9-10, 10-11, or 9-12 */ | ||||
/* Function Basic Registers (FBR) */ | /* Function Basic Registers (FBR) */ | ||||
#define SD_IO_FBR_START 0x00100 | #define SD_IO_FBR_START 0x00100 | ||||
#define SD_IO_FBR_SIZE 0x00700 | #define SD_IO_FBR_SIZE 0x00700 | ||||
/* Card Information Structure (CIS) */ | /* Card Information Structure (CIS) */ | ||||
#define SD_IO_CIS_START 0x01000 | #define SD_IO_CIS_START 0x01000 | ||||
Done Inline ActionsThese all are independent on the change kind-of and only needed for using the change later; really nothing to do with block_count and block_size. Can you commit them on their own please? bz: These all are independent on the change kind-of and only needed for using the change later… | |||||
Done Inline ActionsDone kibab: Done | |||||
#define SD_IO_CIS_SIZE 0x17000 | #define SD_IO_CIS_SIZE 0x17000 | ||||
/* CIS tuple codes (based on PC Card 16) */ | /* CIS tuple codes (based on PC Card 16) */ | ||||
#define SD_IO_CISTPL_VERS_1 0x15 | #define SD_IO_CISTPL_VERS_1 0x15 | ||||
#define SD_IO_CISTPL_MANFID 0x20 | #define SD_IO_CISTPL_MANFID 0x20 | ||||
#define SD_IO_CISTPL_FUNCID 0x21 | #define SD_IO_CISTPL_FUNCID 0x21 | ||||
#define SD_IO_CISTPL_FUNCE 0x22 | #define SD_IO_CISTPL_FUNCE 0x22 | ||||
#define SD_IO_CISTPL_END 0xff | #define SD_IO_CISTPL_END 0xff | ||||
▲ Show 20 Lines • Show All 143 Lines • Show Last 20 Lines |
It looks like if we add these to the end, we don't break binary compat...
But does camcontrol even know about mmc_data yet?