Date: Sat, 26 May 2007 03:04:59 GMT From: Matt Jacob <mjacob@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 120413 for review Message-ID: <200705260304.l4Q34xQY037391@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=120413 Change 120413 by mjacob@mjexp on 2007/05/26 03:03:58 Remove some stale ioctls that were poorly thought out. Affected files ... .. //depot/projects/mjexp/sys/dev/isp/isp_freebsd.c#28 edit .. //depot/projects/mjexp/sys/dev/isp/isp_ioctl.h#3 edit Differences ... ==== //depot/projects/mjexp/sys/dev/isp/isp_freebsd.c#28 (text+ko) ==== @@ -307,11 +307,6 @@ { ispsoftc_t *isp; int nr, retval = ENOTTY; -#if __FreeBSD_version < 500000 - int s = splcam(); -#else - GIANT_REQUIRED; -#endif isp = isplist; while (isp) { @@ -321,9 +316,6 @@ isp = isp->isp_osinfo.next; } if (isp == NULL) { -#if __FreeBSD_version < 500000 - splx(s); -#endif return (ENXIO); } @@ -354,10 +346,12 @@ break; case ISP_FORCE_CRASH_DUMP: if (IS_FC(isp)) { + ISP_LOCK(isp); isp_freeze_loopdown(isp, "ispioctl(ISP_FORCE_CRASH_DUMP)"); isp_fw_dump(isp); isp_reinit(isp); + ISP_UNLOCK(isp); retval = 0; } break; @@ -380,37 +374,35 @@ retval = EINVAL; break; } - /* - * XXX: Current - */ - if (nr == ISP_ROLE_BOTH) { - isp_prt(isp, ISP_LOGERR, "dual roles not supported"); - retval = EINVAL; - break; - } *(int *)addr = isp->isp_role; isp->isp_role = nr; /* FALLTHROUGH */ case ISP_RESETHBA: + ISP_LOCK(isp); isp_reinit(isp); + ISP_UNLOCK(isp); retval = 0; break; case ISP_RESCAN: if (IS_FC(isp)) { + ISP_LOCK(isp); if (isp_fc_runstate(isp, 5 * 1000000)) { retval = EIO; } else { retval = 0; } + ISP_UNLOCK(isp); } break; case ISP_FC_LIP: if (IS_FC(isp)) { + ISP_LOCK(isp); if (isp_control(isp, ISPCTL_SEND_LIP, 0)) { retval = EIO; } else { retval = 0; } + ISP_UNLOCK(isp); } break; case ISP_FC_GETDINFO: @@ -446,6 +438,7 @@ sp->isp_stat_version = ISP_STATS_VERSION; sp->isp_type = isp->isp_type; sp->isp_revision = isp->isp_revision; + ISP_LOCK(isp); sp->isp_stats[ISP_INTCNT] = isp->isp_intcnt; sp->isp_stats[ISP_INTBOGUS] = isp->isp_intbogus; sp->isp_stats[ISP_INTMBOXC] = isp->isp_intmboxc; @@ -454,10 +447,12 @@ sp->isp_stats[ISP_FPHCCMCPLT] = isp->isp_fphccmplt; sp->isp_stats[ISP_RSCCHIWAT] = isp->isp_rscchiwater; sp->isp_stats[ISP_FPCCHIWAT] = isp->isp_fpcchiwater; + ISP_UNLOCK(isp); retval = 0; break; } case ISP_CLR_STATS: + ISP_LOCK(isp); isp->isp_intcnt = 0; isp->isp_intbogus = 0; isp->isp_intmboxc = 0; @@ -466,6 +461,7 @@ isp->isp_fphccmplt = 0; isp->isp_rscchiwater = 0; isp->isp_fpcchiwater = 0; + ISP_UNLOCK(isp); retval = 0; break; case ISP_FC_GETHINFO: @@ -489,92 +485,6 @@ retval = 0; break; } - case ISP_GET_FC_PARAM: - { - struct isp_fc_param *f = (struct isp_fc_param *) addr; - - if (IS_SCSI(isp)) { - break; - } - f->parameter = 0; - if (strcmp(f->param_name, "framelength") == 0) { - f->parameter = FCPARAM(isp)->isp_maxfrmlen; - retval = 0; - break; - } - if (strcmp(f->param_name, "exec_throttle") == 0) { - f->parameter = FCPARAM(isp)->isp_execthrottle; - retval = 0; - break; - } - if (strcmp(f->param_name, "fullduplex") == 0) { - if (FCPARAM(isp)->isp_fwoptions & ICBOPT_FULL_DUPLEX) - f->parameter = 1; - retval = 0; - break; - } - if (strcmp(f->param_name, "loopid") == 0) { - f->parameter = FCPARAM(isp)->isp_loopid; - retval = 0; - break; - } - retval = EINVAL; - break; - } - case ISP_SET_FC_PARAM: - { - struct isp_fc_param *f = (struct isp_fc_param *) addr; - uint32_t param = f->parameter; - - if (IS_SCSI(isp)) { - break; - } - f->parameter = 0; - if (strcmp(f->param_name, "framelength") == 0) { - if (param != 512 && param != 1024 && param != 1024) { - retval = EINVAL; - break; - } - FCPARAM(isp)->isp_maxfrmlen = param; - retval = 0; - break; - } - if (strcmp(f->param_name, "exec_throttle") == 0) { - if (param < 16 || param > 255) { - retval = EINVAL; - break; - } - FCPARAM(isp)->isp_execthrottle = param; - retval = 0; - break; - } - if (strcmp(f->param_name, "fullduplex") == 0) { - if (param != 0 && param != 1) { - retval = EINVAL; - break; - } - if (param) { - FCPARAM(isp)->isp_fwoptions |= - ICBOPT_FULL_DUPLEX; - } else { - FCPARAM(isp)->isp_fwoptions &= - ~ICBOPT_FULL_DUPLEX; - } - retval = 0; - break; - } - if (strcmp(f->param_name, "loopid") == 0) { - if (param < 0 || param > 125) { - retval = EINVAL; - break; - } - FCPARAM(isp)->isp_loopid = param; - retval = 0; - break; - } - retval = EINVAL; - break; - } case ISP_TSK_MGMT: { int needmarker; @@ -629,7 +539,9 @@ if (needmarker) { isp->isp_sendmarker |= 1; } + ISP_LOCK(isp); retval = isp_control(isp, ISPCTL_RUN_MBOXCMD, &mbs); + ISP_UNLOCK(isp); if (retval) retval = EIO; } @@ -638,9 +550,6 @@ default: break; } -#if __FreeBSD_version < 500000 - splx(s); -#endif return (retval); } ==== //depot/projects/mjexp/sys/dev/isp/isp_ioctl.h#3 (text+ko) ==== @@ -154,29 +154,6 @@ #define ISP_TOPO_FPORT 4 /* F-port */ #define ISP_FC_GETHINFO _IOR(ISP_IOC, 12, struct isp_hba_device) -/* - * Set some internal parameters. This doesn't take effect until - * the chip is reset. - * - * Each parameter is generalized to be a name string with an integer value. - * - * Known parameters are: - * - * Name Value Range - * - * "framelength" 512,1024,2048 - * "exec_throttle" 16..255 - * "fullduplex" 0,1 - * "loopid" 0..125 - */ - -struct isp_fc_param { - char param_name[16]; /* null terminated */ - uint32_t parameter; -}; - -#define ISP_GET_FC_PARAM _IOWR(ISP_IOC, 98, struct isp_fc_param) -#define ISP_SET_FC_PARAM _IOWR(ISP_IOC, 99, struct isp_fc_param) /* * Various Reset Goodies
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200705260304.l4Q34xQY037391>