/*
* linux/drivers/mmc/mmc.c
*
- * Copyright (C) 2003 Russell King, All Rights Reserved.
+ * Copyright (C) 2003-2004 Russell King, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
#include <linux/completion.h>
#include <linux/device.h>
#include <linux/delay.h>
+#include <linux/pagemap.h>
#include <linux/err.h>
#include <linux/mmc/card.h>
INIT_WORK(&host->detect, mmc_rescan, host);
host->dev = dev;
+
+ /*
+ * By default, hosts do not support SGIO or large requests.
+ * They have to set these according to their abilities.
+ */
+ host->max_hw_segs = 1;
+ host->max_phys_segs = 1;
+ host->max_sectors = 1 << (PAGE_CACHE_SHIFT - 9);
+ host->max_seg_size = PAGE_CACHE_SIZE;
}
return host;
#define MMC_SHIFT 3
static int mmc_major;
-static int maxsectors = 8;
/*
* There is one mmc_blk_data per slot.
md->block_bits = card->csd.read_blkbits;
- blk_queue_max_sectors(md->queue.queue, maxsectors);
blk_queue_hardsect_size(md->queue.queue, 1 << md->block_bits);
set_capacity(md->disk, card->csd.capacity);
}
module_init(mmc_blk_init);
module_exit(mmc_blk_exit);
-module_param(maxsectors, int, 0444);
-
-MODULE_PARM_DESC(maxsectors, "Maximum number of sectors for a single request");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Multimedia Card (MMC) block device driver");
*/
int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock)
{
+ struct mmc_host *host = card->host;
u64 limit = BLK_BOUNCE_HIGH;
int ret;
- if (card->host->dev->dma_mask && *card->host->dev->dma_mask)
- limit = *card->host->dev->dma_mask;
+ if (host->dev->dma_mask && *host->dev->dma_mask)
+ limit = *host->dev->dma_mask;
mq->card = card;
mq->queue = blk_init_queue(mmc_request, lock);
blk_queue_prep_rq(mq->queue, mmc_prep_request);
blk_queue_bounce_limit(mq->queue, limit);
+ blk_queue_max_sectors(mq->queue, host->max_sectors);
+ blk_queue_max_phys_segments(mq->queue, host->max_phys_segs);
+ blk_queue_max_hw_segments(mq->queue, host->max_hw_segs);
+ blk_queue_max_segment_size(mq->queue, host->max_seg_size);
mq->queue->queuedata = mq;
mq->req = NULL;
u32 ocr_avail;
char host_name[8];
+ /* host specific block data */
+ unsigned int max_seg_size; /* see blk_queue_max_segment_size */
+ unsigned short max_hw_segs; /* see blk_queue_max_hw_segments */
+ unsigned short max_phys_segs; /* see blk_queue_max_phys_segments */
+ unsigned short max_sectors; /* see blk_queue_max_sectors */
+ unsigned short unused;
+
/* private data */
struct mmc_ios ios; /* current io bus settings */
u32 ocr; /* the current OCR setting */