aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/mg_disk.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/mg_disk.c')
-rw-r--r--drivers/block/mg_disk.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/block/mg_disk.c b/drivers/block/mg_disk.c
index 71e56cc28cac..826c3492b9fe 100644
--- a/drivers/block/mg_disk.c
+++ b/drivers/block/mg_disk.c
@@ -220,7 +220,8 @@ static void mg_dump_status(const char *msg, unsigned int stat,
220 if (host->breq) { 220 if (host->breq) {
221 req = elv_next_request(host->breq); 221 req = elv_next_request(host->breq);
222 if (req) 222 if (req)
223 printk(", sector=%u", (u32)req->sector); 223 printk(", sector=%u",
224 (unsigned int)blk_rq_pos(req));
224 } 225 }
225 226
226 } 227 }
@@ -493,12 +494,12 @@ static void mg_read(struct request *req)
493 u32 j; 494 u32 j;
494 struct mg_host *host = req->rq_disk->private_data; 495 struct mg_host *host = req->rq_disk->private_data;
495 496
496 if (mg_out(host, req->sector, req->nr_sectors, MG_CMD_RD, NULL) != 497 if (mg_out(host, blk_rq_pos(req), blk_rq_sectors(req),
497 MG_ERR_NONE) 498 MG_CMD_RD, NULL) != MG_ERR_NONE)
498 mg_bad_rw_intr(host); 499 mg_bad_rw_intr(host);
499 500
500 MG_DBG("requested %d sects (from %ld), buffer=0x%p\n", 501 MG_DBG("requested %d sects (from %ld), buffer=0x%p\n",
501 req->nr_sectors, req->sector, req->buffer); 502 blk_rq_sectors(req), blk_rq_pos(req), req->buffer);
502 503
503 do { 504 do {
504 u16 *buff = (u16 *)req->buffer; 505 u16 *buff = (u16 *)req->buffer;
@@ -522,14 +523,14 @@ static void mg_write(struct request *req)
522 u32 j; 523 u32 j;
523 struct mg_host *host = req->rq_disk->private_data; 524 struct mg_host *host = req->rq_disk->private_data;
524 525
525 if (mg_out(host, req->sector, req->nr_sectors, MG_CMD_WR, NULL) != 526 if (mg_out(host, blk_rq_pos(req), blk_rq_sectors(req),
526 MG_ERR_NONE) { 527 MG_CMD_WR, NULL) != MG_ERR_NONE) {
527 mg_bad_rw_intr(host); 528 mg_bad_rw_intr(host);
528 return; 529 return;
529 } 530 }
530 531
531 MG_DBG("requested %d sects (from %ld), buffer=0x%p\n", 532 MG_DBG("requested %d sects (from %ld), buffer=0x%p\n",
532 req->nr_sectors, req->sector, req->buffer); 533 blk_rq_sectors(req), blk_rq_pos(req), req->buffer);
533 534
534 do { 535 do {
535 u16 *buff = (u16 *)req->buffer; 536 u16 *buff = (u16 *)req->buffer;
@@ -579,7 +580,7 @@ ok_to_read:
579 (i << 1)); 580 (i << 1));
580 581
581 MG_DBG("sector %ld, remaining=%ld, buffer=0x%p\n", 582 MG_DBG("sector %ld, remaining=%ld, buffer=0x%p\n",
582 req->sector, req->nr_sectors - 1, req->buffer); 583 blk_rq_pos(req), blk_rq_sectors(req) - 1, req->buffer);
583 584
584 /* send read confirm */ 585 /* send read confirm */
585 outb(MG_CMD_RD_CONF, (unsigned long)host->dev_base + MG_REG_COMMAND); 586 outb(MG_CMD_RD_CONF, (unsigned long)host->dev_base + MG_REG_COMMAND);
@@ -609,7 +610,7 @@ static void mg_write_intr(struct mg_host *host)
609 break; 610 break;
610 if (!MG_READY_OK(i)) 611 if (!MG_READY_OK(i))
611 break; 612 break;
612 if ((req->nr_sectors <= 1) || (i & ATA_DRQ)) 613 if ((blk_rq_sectors(req) <= 1) || (i & ATA_DRQ))
613 goto ok_to_write; 614 goto ok_to_write;
614 } while (0); 615 } while (0);
615 mg_dump_status("mg_write_intr", i, host); 616 mg_dump_status("mg_write_intr", i, host);
@@ -627,7 +628,7 @@ ok_to_write:
627 buff++; 628 buff++;
628 } 629 }
629 MG_DBG("sector %ld, remaining=%ld, buffer=0x%p\n", 630 MG_DBG("sector %ld, remaining=%ld, buffer=0x%p\n",
630 req->sector, req->nr_sectors, req->buffer); 631 blk_rq_pos(req), blk_rq_sectors(req), req->buffer);
631 host->mg_do_intr = mg_write_intr; 632 host->mg_do_intr = mg_write_intr;
632 mod_timer(&host->timer, jiffies + 3 * HZ); 633 mod_timer(&host->timer, jiffies + 3 * HZ);
633 } 634 }
@@ -749,9 +750,9 @@ static void mg_request(struct request_queue *q)
749 750
750 del_timer(&host->timer); 751 del_timer(&host->timer);
751 752
752 sect_num = req->sector; 753 sect_num = blk_rq_pos(req);
753 /* deal whole segments */ 754 /* deal whole segments */
754 sect_cnt = req->nr_sectors; 755 sect_cnt = blk_rq_sectors(req);
755 756
756 /* sanity check */ 757 /* sanity check */
757 if (sect_num >= get_capacity(req->rq_disk) || 758 if (sect_num >= get_capacity(req->rq_disk) ||