From 319222274a42eb7896d93ffbb77857ec9a3bccce Mon Sep 17 00:00:00 2001 From: Hidetoshi Shimokawa Date: Fri, 16 Mar 2007 01:23:36 +0000 Subject: [PATCH] Support MAXPHYS up to 512KB - We need at least two OCBs with indirect pointers allocated in a 4KB page. - SBP_MAXPHYS can increase to 1MB once we separate management OCB/ORB which usually does not need indirect pointers. - We have to increase SBP_DMA_SIZE for MAXPHYS larger than 1MB. MFC after: 3 days --- sys/dev/firewire/sbp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/firewire/sbp.c b/sys/dev/firewire/sbp.c index 2f6dbf3727a0..0967652aad77 100644 --- a/sys/dev/firewire/sbp.c +++ b/sys/dev/firewire/sbp.c @@ -91,6 +91,7 @@ * because of CAM_SCSI2_MAXLUN in cam_xpt.c */ #define SBP_NUM_LUNS 64 +#define SBP_MAXPHYS MIN(MAXPHYS, (512*1024) /* 512KB */) #define SBP_DMA_SIZE PAGE_SIZE #define SBP_LOGIN_SIZE sizeof(struct sbp_login_res) #define SBP_QUEUE_LEN ((SBP_DMA_SIZE - SBP_LOGIN_SIZE) / sizeof(struct sbp_ocb)) @@ -161,9 +162,9 @@ TUNABLE_INT("hw.firewire.sbp.tags", &sbp_tags); #define SBP_SEG_MAX rounddown(0xffff, PAGE_SIZE) #ifdef __sparc64__ /* iommu */ -#define SBP_IND_MAX howmany(MAXPHYS, SBP_SEG_MAX) +#define SBP_IND_MAX howmany(SBP_MAXPHYS, SBP_SEG_MAX) #else -#define SBP_IND_MAX howmany(MAXPHYS, PAGE_SIZE) +#define SBP_IND_MAX howmany(SBP_MAXPHYS, PAGE_SIZE) #endif struct sbp_ocb { STAILQ_ENTRY(sbp_ocb) ocb;