diff options
author | marius <marius@FreeBSD.org> | 2011-11-23 21:43:51 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2011-11-23 21:43:51 +0000 |
commit | c5cf0f6b20206d14255b5200ec08705a768ac451 (patch) | |
tree | 07604949d086d79c0b4929545a210d0cc779bb03 /sys/dev/hptrr/hptrr_osm_bsd.c | |
parent | 0f30a4cf8906e3cbfa5895b21f8f9232f17e39bb (diff) | |
download | FreeBSD-src-c5cf0f6b20206d14255b5200ec08705a768ac451.zip FreeBSD-src-c5cf0f6b20206d14255b5200ec08705a768ac451.tar.gz |
- Just use cam_calc_geometry(9) on newer version of FreeBSD rather than
duplicating it.
- In hptmv(4) and hptrr(4) use __FBSDID and DEVMETHOD_END.
Diffstat (limited to 'sys/dev/hptrr/hptrr_osm_bsd.c')
-rw-r--r-- | sys/dev/hptrr/hptrr_osm_bsd.c | 12 |
1 files changed, 9 insertions, 3 deletions
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 = { |