aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/hptmv/entry.c
diff options
context:
space:
mode:
authorMarius Strobl <marius@FreeBSD.org>2011-11-23 21:43:51 +0000
committerMarius Strobl <marius@FreeBSD.org>2011-11-23 21:43:51 +0000
commitf3b080e6abb087a3bb43c2e45d14b8ff430acbdc (patch)
tree07604949d086d79c0b4929545a210d0cc779bb03 /sys/dev/hptmv/entry.c
parent604f5f1f7790b303eb28109c3138dd3c1a1c0dff (diff)
Notes
Diffstat (limited to 'sys/dev/hptmv/entry.c')
-rw-r--r--sys/dev/hptmv/entry.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/sys/dev/hptmv/entry.c b/sys/dev/hptmv/entry.c
index b1b4f2464c5e..4c61e655898c 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 */
{