From 59190eaa10fd2b820001f589ca3f1ed6fcd466b3 Mon Sep 17 00:00:00 2001 From: "Kenneth D. Merry" Date: Tue, 19 Jan 1999 01:02:47 +0000 Subject: Generalize the quirk entry for the Conner CFP* drives. It did just cover the CFP2107, but it appears (not surprisingly) that the 1 gig and 4 gig versions of that drive have the same problem with tagged queueing. Also, fix the problem reported in PR kern/9482. The XPT_DEV_MATCH case in xptioctl() wasn't putting a proper path in the CCB before it called xpt_action(). When CAMDEBUG is defined, and CAM_DEBUG_TRACE debugging is turned on, the CAM_DEBUG statement at the beginning of xpt_action would end up deferencing a NULL path pointer. That of course caused a panic. My solution is to just stick the xpt peripheral's path in the CCB. PR: kern/9482 Reviewed by: gibbs --- sys/cam/cam_xpt.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 2d3b3d8fd718..bef1703ce66b 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -2,7 +2,7 @@ * Implementation of the Common Access Method Transport (XPT) layer. * * Copyright (c) 1997, 1998, 1999 Justin T. Gibbs. - * Copyright (c) 1997, 1998 Kenneth D. Merry. + * Copyright (c) 1997, 1998, 1999 Kenneth D. Merry. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cam_xpt.c,v 1.36 1999/01/14 06:03:59 gibbs Exp $ + * $Id: cam_xpt.c,v 1.37 1999/01/19 00:13:05 peter Exp $ */ #include #include @@ -301,7 +301,7 @@ static struct xpt_quirk_entry xpt_quirk_table[] = }, { /* Broken tagged queuing drive */ - { T_DIRECT, SIP_MEDIA_FIXED, "CONNER", "CFP2107*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "CONNER", "CFP*", "*" }, /*quirks*/0, /*mintags*/0, /*maxtags*/0 }, { @@ -914,6 +914,7 @@ xptioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) } case XPT_DEV_MATCH: { struct cam_periph_map_info mapinfo; + struct cam_path *old_path; /* * We can't deal with physical addresses for this @@ -923,6 +924,21 @@ xptioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) error = EINVAL; break; } + + /* + * Save this in case the caller had it set to + * something in particular. + */ + old_path = inccb->ccb_h.path; + + /* + * We really don't need a path for the matching + * code. The path is needed because of the + * debugging statements in xpt_action(). They + * assume that the CCB has a valid path. + */ + inccb->ccb_h.path = xpt_periph->path; + bzero(&mapinfo, sizeof(mapinfo)); /* @@ -931,8 +947,10 @@ xptioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) */ error = cam_periph_mapmem(inccb, &mapinfo); - if (error) + if (error) { + inccb->ccb_h.path = old_path; break; + } /* * This is an immediate CCB, we can send it on directly. @@ -944,6 +962,8 @@ xptioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) */ cam_periph_unmapmem(inccb, &mapinfo); + inccb->ccb_h.path = old_path; + error = 0; break; } -- cgit v1.3