Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107547785
D30387.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D30387.diff
View Options
diff --git a/sys/dev/mmc/host/dwmmc.c b/sys/dev/mmc/host/dwmmc.c
--- a/sys/dev/mmc/host/dwmmc.c
+++ b/sys/dev/mmc/host/dwmmc.c
@@ -145,6 +145,11 @@
* second half of page
*/
#define IDMAC_MAX_SIZE 2048
+/*
+ * Busdma may bounce buffers, so we must reserve 2 descriptors
+ * (on start and on end) for bounced fragments.
+ */
+#define DWMMC_MAX_DATA (IDMAC_MAX_SIZE * (IDMAC_DESC_SEGS - 2)) / MMC_SECTOR_SIZE
static void dwmmc_next_operation(struct dwmmc_softc *);
static int dwmmc_setup_bus(struct dwmmc_softc *, int);
@@ -1358,13 +1363,7 @@
*(int *)result = sc->host.caps;
break;
case MMCBR_IVAR_MAX_DATA:
- /*
- * Busdma may bounce buffers, so we must reserve 2 descriptors
- * (on start and on end) for bounced fragments.
- *
- */
- *(int *)result = (IDMAC_MAX_SIZE * IDMAC_DESC_SEGS) /
- MMC_SECTOR_SIZE - 3;
+ *(int *)result = DWMMC_MAX_DATA;
break;
case MMCBR_IVAR_TIMING:
*(int *)result = sc->host.ios.timing;
@@ -1444,7 +1443,7 @@
cts->host_f_min = sc->host.f_min;
cts->host_f_max = sc->host.f_max;
cts->host_caps = sc->host.caps;
- cts->host_max_data = (IDMAC_MAX_SIZE * IDMAC_DESC_SEGS) / MMC_SECTOR_SIZE;
+ cts->host_max_data = DWMMC_MAX_DATA;
memcpy(&cts->ios, &sc->host.ios, sizeof(struct mmc_ios));
return (0);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 16, 5:45 PM (21 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15827822
Default Alt Text
D30387.diff (1 KB)
Attached To
Mode
D30387: Make the code consistent with the comments
Attached
Detach File
Event Timeline
Log In to Comment