diff options
-rw-r--r-- | sys/dev/arcmsr/arcmsr.c | 17 | ||||
-rw-r--r-- | sys/dev/hptiop/hptiop.c | 4 | ||||
-rw-r--r-- | sys/dev/hptmv/entry.c | 15 | ||||
-rw-r--r-- | sys/dev/hptrr/hptrr_osm_bsd.c | 12 |
4 files changed, 34 insertions, 14 deletions
diff --git a/sys/dev/arcmsr/arcmsr.c b/sys/dev/arcmsr/arcmsr.c index b672176..9fde306 100644 --- a/sys/dev/arcmsr/arcmsr.c +++ b/sys/dev/arcmsr/arcmsr.c @@ -2714,16 +2714,20 @@ static void arcmsr_action(struct cam_sim * psim, union ccb * pccb) xpt_done(pccb); break; } - case XPT_CALC_GEOMETRY: { - struct ccb_calc_geometry *ccg; - u_int32_t size_mb; - u_int32_t secs_per_cylinder; - + case XPT_CALC_GEOMETRY: if(pccb->ccb_h.target_id == 16) { pccb->ccb_h.status |= CAM_FUNC_NOTAVAIL; xpt_done(pccb); break; } +#if __FreeBSD_version >= 500000 + cam_calc_geometry(&pccb->ccg, 1); +#else + { + struct ccb_calc_geometry *ccg; + u_int32_t size_mb; + u_int32_t secs_per_cylinder; + ccg= &pccb->ccg; if (ccg->block_size == 0) { pccb->ccb_h.status = CAM_REQ_INVALID; @@ -2746,9 +2750,10 @@ static void arcmsr_action(struct cam_sim * psim, union ccb * pccb) secs_per_cylinder=ccg->heads * ccg->secs_per_track; ccg->cylinders=ccg->volume_size / secs_per_cylinder; pccb->ccb_h.status |= CAM_REQ_CMP; + } +#endif xpt_done(pccb); break; - } default: pccb->ccb_h.status |= CAM_REQ_INVALID; xpt_done(pccb); diff --git a/sys/dev/hptiop/hptiop.c b/sys/dev/hptiop/hptiop.c index c4e2427..035cf07 100644 --- a/sys/dev/hptiop/hptiop.c +++ b/sys/dev/hptiop/hptiop.c @@ -1813,11 +1813,15 @@ scsi_done: break; case XPT_CALC_GEOMETRY: +#if __FreeBSD_version >= 500000 + cam_calc_geometry(&ccb->ccg, 1); +#else ccb->ccg.heads = 255; ccb->ccg.secs_per_track = 63; ccb->ccg.cylinders = ccb->ccg.volume_size / (ccb->ccg.heads * ccb->ccg.secs_per_track); ccb->ccb_h.status = CAM_REQ_CMP; +#endif break; case XPT_PATH_INQ: diff --git a/sys/dev/hptmv/entry.c b/sys/dev/hptmv/entry.c index b1b4f24..4c61e65 100644 --- a/sys/dev/hptmv/entry.c +++ b/sys/dev/hptmv/entry.c @@ -22,9 +22,10 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ + +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/systm.h> @@ -94,7 +95,7 @@ static device_method_t driver_methods[] = { DEVMETHOD(device_detach, hpt_detach), DEVMETHOD(device_shutdown, hpt_shutdown), - { 0, 0 } + DEVMETHOD_END }; static driver_t hpt_pci_driver = { @@ -2371,7 +2372,10 @@ hpt_action(struct cam_sim *sim, union ccb *ccb) break; case XPT_CALC_GEOMETRY: - { +#if __FreeBSD_version >= 500000 + cam_calc_geometry(&ccb->ccg, 1); +#else + { struct ccb_calc_geometry *ccg; u_int32_t size_mb; u_int32_t secs_per_cylinder; @@ -2389,9 +2393,10 @@ hpt_action(struct cam_sim *sim, union ccb *ccb) secs_per_cylinder = ccg->heads * ccg->secs_per_track; ccg->cylinders = ccg->volume_size / secs_per_cylinder; ccb->ccb_h.status = CAM_REQ_CMP; + } +#endif xpt_done(ccb); break; - } case XPT_PATH_INQ: /* Path routing inquiry */ { diff --git a/sys/dev/hptrr/hptrr_osm_bsd.c b/sys/dev/hptrr/hptrr_osm_bsd.c index 0469791..1f6b19a 100644 --- a/sys/dev/hptrr/hptrr_osm_bsd.c +++ b/sys/dev/hptrr/hptrr_osm_bsd.c @@ -22,9 +22,11 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ + +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + #include <dev/hptrr/hptrr_config.h> /* $Id: osm_bsd.c,v 1.27 2007/11/22 07:35:49 gmm Exp $ * @@ -795,10 +797,14 @@ static void hpt_action(struct cam_sim *sim, union ccb *ccb) break; case XPT_CALC_GEOMETRY: +#if __FreeBSD_version >= 500000 + cam_calc_geometry(&ccb->ccg, 1); +#else ccb->ccg.heads = 255; ccb->ccg.secs_per_track = 63; ccb->ccg.cylinders = ccb->ccg.volume_size / (ccb->ccg.heads * ccb->ccg.secs_per_track); ccb->ccb_h.status = CAM_REQ_CMP; +#endif break; case XPT_PATH_INQ: @@ -1250,7 +1256,7 @@ static device_method_t driver_methods[] = { DEVMETHOD(device_attach, hpt_attach), DEVMETHOD(device_detach, hpt_detach), DEVMETHOD(device_shutdown, hpt_shutdown), - { 0, 0 } + DEVMETHOD_END }; static driver_t hpt_pci_driver = { |