aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/memstick/core
diff options
context:
space:
mode:
authorAlex Dubov <oakad@yahoo.com>2008-03-10 14:43:37 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-03-10 21:01:18 -0400
commite1f19995f55294fbb00ea22ba85d7b0d80ba3813 (patch)
tree0369d9e9a142000964d3204cb128c826986c94af /drivers/memstick/core
parentb614ce8b3c697947d75685f0b9f2059307dde715 (diff)
memstick: introduce correct definitions in the header
Thanks to some input from kind people at JMicron it is now possible to have more correct definitions of protocol structures and bit field semantics. Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/memstick/core')
-rw-r--r--drivers/memstick/core/memstick.c4
-rw-r--r--drivers/memstick/core/mspro_block.c16
2 files changed, 10 insertions, 10 deletions
diff --git a/drivers/memstick/core/memstick.c b/drivers/memstick/core/memstick.c
index bba467fe4bce..5e0e960df456 100644
--- a/drivers/memstick/core/memstick.c
+++ b/drivers/memstick/core/memstick.c
@@ -271,7 +271,7 @@ void memstick_init_req_sg(struct memstick_request *mrq, unsigned char tpc,
271 mrq->data_dir = READ; 271 mrq->data_dir = READ;
272 272
273 mrq->sg = *sg; 273 mrq->sg = *sg;
274 mrq->io_type = MEMSTICK_IO_SG; 274 mrq->long_data = 1;
275 275
276 if (tpc == MS_TPC_SET_CMD || tpc == MS_TPC_EX_SET_CMD) 276 if (tpc == MS_TPC_SET_CMD || tpc == MS_TPC_EX_SET_CMD)
277 mrq->need_card_int = 1; 277 mrq->need_card_int = 1;
@@ -306,7 +306,7 @@ void memstick_init_req(struct memstick_request *mrq, unsigned char tpc,
306 if (mrq->data_dir == WRITE) 306 if (mrq->data_dir == WRITE)
307 memcpy(mrq->data, buf, mrq->data_len); 307 memcpy(mrq->data, buf, mrq->data_len);
308 308
309 mrq->io_type = MEMSTICK_IO_VAL; 309 mrq->long_data = 0;
310 310
311 if (tpc == MS_TPC_SET_CMD || tpc == MS_TPC_EX_SET_CMD) 311 if (tpc == MS_TPC_SET_CMD || tpc == MS_TPC_EX_SET_CMD)
312 mrq->need_card_int = 1; 312 mrq->need_card_int = 1;
diff --git a/drivers/memstick/core/mspro_block.c b/drivers/memstick/core/mspro_block.c
index 423ad8cf4bb9..214211c8ac9a 100644
--- a/drivers/memstick/core/mspro_block.c
+++ b/drivers/memstick/core/mspro_block.c
@@ -629,7 +629,7 @@ static void mspro_block_process_request(struct memstick_dev *card,
629 param.system = msb->system; 629 param.system = msb->system;
630 param.data_count = cpu_to_be16(page_count); 630 param.data_count = cpu_to_be16(page_count);
631 param.data_address = cpu_to_be32((uint32_t)t_sec); 631 param.data_address = cpu_to_be32((uint32_t)t_sec);
632 param.cmd_param = 0; 632 param.tpc_param = 0;
633 633
634 msb->data_dir = rq_data_dir(req); 634 msb->data_dir = rq_data_dir(req);
635 msb->transfer_cmd = msb->data_dir == READ 635 msb->transfer_cmd = msb->data_dir == READ
@@ -761,7 +761,7 @@ static int mspro_block_switch_to_parallel(struct memstick_dev *card)
761 .system = 0, 761 .system = 0,
762 .data_count = 0, 762 .data_count = 0,
763 .data_address = 0, 763 .data_address = 0,
764 .cmd_param = 0 764 .tpc_param = 0
765 }; 765 };
766 766
767 card->next_request = h_mspro_block_req_init; 767 card->next_request = h_mspro_block_req_init;
@@ -773,8 +773,8 @@ static int mspro_block_switch_to_parallel(struct memstick_dev *card)
773 if (card->current_mrq.error) 773 if (card->current_mrq.error)
774 return card->current_mrq.error; 774 return card->current_mrq.error;
775 775
776 msb->system = 0; 776 msb->system = MEMSTICK_SYS_PAR4;
777 host->set_param(host, MEMSTICK_INTERFACE, MEMSTICK_PARALLEL); 777 host->set_param(host, MEMSTICK_INTERFACE, MEMSTICK_PAR4);
778 778
779 card->next_request = h_mspro_block_req_init; 779 card->next_request = h_mspro_block_req_init;
780 msb->mrq_handler = h_mspro_block_default; 780 msb->mrq_handler = h_mspro_block_default;
@@ -802,7 +802,7 @@ static int mspro_block_read_attributes(struct memstick_dev *card)
802 .system = msb->system, 802 .system = msb->system,
803 .data_count = cpu_to_be16(1), 803 .data_count = cpu_to_be16(1),
804 .data_address = 0, 804 .data_address = 0,
805 .cmd_param = 0 805 .tpc_param = 0
806 }; 806 };
807 struct mspro_attribute *attr = NULL; 807 struct mspro_attribute *attr = NULL;
808 struct mspro_sys_attr *s_attr = NULL; 808 struct mspro_sys_attr *s_attr = NULL;
@@ -922,7 +922,7 @@ static int mspro_block_read_attributes(struct memstick_dev *card)
922 param.system = msb->system; 922 param.system = msb->system;
923 param.data_count = cpu_to_be16((rc / msb->page_size) + 1); 923 param.data_count = cpu_to_be16((rc / msb->page_size) + 1);
924 param.data_address = cpu_to_be32(addr / msb->page_size); 924 param.data_address = cpu_to_be32(addr / msb->page_size);
925 param.cmd_param = 0; 925 param.tpc_param = 0;
926 926
927 sg_init_one(&msb->req_sg[0], buffer, 927 sg_init_one(&msb->req_sg[0], buffer,
928 be16_to_cpu(param.data_count) * msb->page_size); 928 be16_to_cpu(param.data_count) * msb->page_size);
@@ -964,7 +964,7 @@ static int mspro_block_init_card(struct memstick_dev *card)
964 struct memstick_host *host = card->host; 964 struct memstick_host *host = card->host;
965 int rc = 0; 965 int rc = 0;
966 966
967 msb->system = 0x80; 967 msb->system = MEMSTICK_SYS_SERIAL;
968 card->reg_addr.r_offset = offsetof(struct mspro_register, status); 968 card->reg_addr.r_offset = offsetof(struct mspro_register, status);
969 card->reg_addr.r_length = sizeof(struct ms_status_register); 969 card->reg_addr.r_length = sizeof(struct ms_status_register);
970 card->reg_addr.w_offset = offsetof(struct mspro_register, param); 970 card->reg_addr.w_offset = offsetof(struct mspro_register, param);
@@ -973,7 +973,7 @@ static int mspro_block_init_card(struct memstick_dev *card)
973 if (memstick_set_rw_addr(card)) 973 if (memstick_set_rw_addr(card))
974 return -EIO; 974 return -EIO;
975 975
976 if (host->caps & MEMSTICK_CAP_PARALLEL) { 976 if (host->caps & MEMSTICK_CAP_PAR4) {
977 if (mspro_block_switch_to_parallel(card)) 977 if (mspro_block_switch_to_parallel(card))
978 printk(KERN_WARNING "%s: could not switch to " 978 printk(KERN_WARNING "%s: could not switch to "
979 "parallel interface\n", card->dev.bus_id); 979 "parallel interface\n", card->dev.bus_id);