Deleted Added
full compact
isp_freebsd.c (43790) isp_freebsd.c (44819)
1/* $Id: isp_freebsd.c,v 1.11 1999/01/30 07:29:00 mjacob Exp $ */
2/* release_02_05_99 */
1/* $Id: isp_freebsd.c,v 1.12 1999/02/09 01:08:38 mjacob Exp $ */
2/* release_03_16_99 */
3/*
4 * Platform (FreeBSD) dependent common attachment code for Qlogic adapters.
5 *
6 *---------------------------------------
7 * Copyright (c) 1997, 1998 by Matthew Jacob
8 * NASA/Ames Research Center
9 * All rights reserved.
10 *---------------------------------------

--- 76 unchanged lines hidden (view full) ---

87 * Set base transfer capabilities for Fibre Channel.
88 * Technically not correct because we don't know
89 * what media we're running on top of- but we'll
90 * look good if we always say 100MB/s.
91 */
92 if (isp->isp_type & ISP_HA_FC) {
93 isp->isp_sim->base_transfer_speed = 100000;
94 }
3/*
4 * Platform (FreeBSD) dependent common attachment code for Qlogic adapters.
5 *
6 *---------------------------------------
7 * Copyright (c) 1997, 1998 by Matthew Jacob
8 * NASA/Ames Research Center
9 * All rights reserved.
10 *---------------------------------------

--- 76 unchanged lines hidden (view full) ---

87 * Set base transfer capabilities for Fibre Channel.
88 * Technically not correct because we don't know
89 * what media we're running on top of- but we'll
90 * look good if we always say 100MB/s.
91 */
92 if (isp->isp_type & ISP_HA_FC) {
93 isp->isp_sim->base_transfer_speed = 100000;
94 }
95 isp->isp_state = ISP_RUNSTATE;
95 if (isp->isp_state == ISP_INITSTATE)
96 isp->isp_state = ISP_RUNSTATE;
96}
97
98static void
99isp_cam_async(void *cbarg, u_int32_t code, struct cam_path *path, void *arg)
100{
101 struct cam_sim *sim;
102 struct ispsoftc *isp;
103

--- 39 unchanged lines hidden (view full) ---

143 struct ispsoftc *isp;
144 struct ccb_trans_settings *cts;
145
146 CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, ("isp_action\n"));
147
148 isp = (struct ispsoftc *)cam_sim_softc(sim);
149 ccb->ccb_h.sim_priv.entries[0].field = 0;
150 ccb->ccb_h.sim_priv.entries[1].ptr = isp;
97}
98
99static void
100isp_cam_async(void *cbarg, u_int32_t code, struct cam_path *path, void *arg)
101{
102 struct cam_sim *sim;
103 struct ispsoftc *isp;
104

--- 39 unchanged lines hidden (view full) ---

144 struct ispsoftc *isp;
145 struct ccb_trans_settings *cts;
146
147 CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, ("isp_action\n"));
148
149 isp = (struct ispsoftc *)cam_sim_softc(sim);
150 ccb->ccb_h.sim_priv.entries[0].field = 0;
151 ccb->ccb_h.sim_priv.entries[1].ptr = isp;
152 /*
153 * This should only happen for Fibre Channel adapters.
154 * We want to pass through all but XPT_SCSI_IO (e.g.,
155 * path inquiry) but fail if we can't get good Fibre
156 * Channel link status.
157 */
158 if (ccb->ccb_h.func_code == XPT_SCSI_IO &&
159 isp->isp_state != ISP_RUNSTATE) {
160 s = splcam();
161 DISABLE_INTS(isp);
162 isp_init(isp);
163 if (isp->isp_state != ISP_INITSTATE) {
164 (void) splx(s);
165 /*
166 * Lie. Say it was a selection timeout.
167 */
168 ccb->ccb_h.status = CAM_SEL_TIMEOUT;
169 xpt_done(ccb);
170 return;
171 }
172 isp->isp_state = ISP_RUNSTATE;
173 ENABLE_INTS(isp);
174 (void) splx(s);
175 }
151
152 IDPRINTF(4, ("%s: isp_action code %x\n", isp->isp_name,
153 ccb->ccb_h.func_code));
154
155 switch (ccb->ccb_h.func_code) {
156 case XPT_SCSI_IO: /* Execute the requested I/O operation */
157 /*
158 * Do a couple of preliminary checks...

--- 54 unchanged lines hidden (view full) ---

213
214 s = splcam();
215 DISABLE_INTS(isp);
216 switch (ispscsicmd((ISP_SCSI_XFER_T *) ccb)) {
217 case CMD_QUEUED:
218 ccb->ccb_h.status |= CAM_SIM_QUEUED;
219 break;
220 case CMD_EAGAIN:
176
177 IDPRINTF(4, ("%s: isp_action code %x\n", isp->isp_name,
178 ccb->ccb_h.func_code));
179
180 switch (ccb->ccb_h.func_code) {
181 case XPT_SCSI_IO: /* Execute the requested I/O operation */
182 /*
183 * Do a couple of preliminary checks...

--- 54 unchanged lines hidden (view full) ---

238
239 s = splcam();
240 DISABLE_INTS(isp);
241 switch (ispscsicmd((ISP_SCSI_XFER_T *) ccb)) {
242 case CMD_QUEUED:
243 ccb->ccb_h.status |= CAM_SIM_QUEUED;
244 break;
245 case CMD_EAGAIN:
221 if (isp->isp_osinfo.simqfrozen == 0) {
246 if (!(isp->isp_osinfo.simqfrozen & SIMQFRZ_RESOURCE)) {
222 xpt_freeze_simq(sim, 1);
247 xpt_freeze_simq(sim, 1);
223 isp->isp_osinfo.simqfrozen = 1;
248 isp->isp_osinfo.simqfrozen |= SIMQFRZ_RESOURCE;
224 }
225 ccb->ccb_h.status &= ~CAM_STATUS_MASK;
226 ccb->ccb_h.status |= CAM_REQUEUE_REQ;
227 xpt_done(ccb);
228 break;
229 case CMD_COMPLETE:
230 /*
231 * Just make sure that we didn't get it returned

--- 310 unchanged lines hidden (view full) ---

542 if ((sccb->ccb_h.status & CAM_DEV_QFRZN) == 0) {
543 IDPRINTF(3, ("%s: freeze devq %d.%d ccbstat 0x%x\n",
544 isp->isp_name, sccb->ccb_h.target_id,
545 sccb->ccb_h.target_lun, sccb->ccb_h.status));
546 xpt_freeze_devq(sccb->ccb_h.path, 1);
547 sccb->ccb_h.status |= CAM_DEV_QFRZN;
548 }
549 }
249 }
250 ccb->ccb_h.status &= ~CAM_STATUS_MASK;
251 ccb->ccb_h.status |= CAM_REQUEUE_REQ;
252 xpt_done(ccb);
253 break;
254 case CMD_COMPLETE:
255 /*
256 * Just make sure that we didn't get it returned

--- 310 unchanged lines hidden (view full) ---

567 if ((sccb->ccb_h.status & CAM_DEV_QFRZN) == 0) {
568 IDPRINTF(3, ("%s: freeze devq %d.%d ccbstat 0x%x\n",
569 isp->isp_name, sccb->ccb_h.target_id,
570 sccb->ccb_h.target_lun, sccb->ccb_h.status));
571 xpt_freeze_devq(sccb->ccb_h.path, 1);
572 sccb->ccb_h.status |= CAM_DEV_QFRZN;
573 }
574 }
550 if (isp->isp_osinfo.simqfrozen) {
551
552 xpt_print_path(sccb->ccb_h.path);
553 printf("isp_done releasing SIMQ\n");
554
575 if (isp->isp_osinfo.simqfrozen & SIMQFRZ_RESOURCE) {
576 isp->isp_osinfo.simqfrozen &= ~SIMQFRZ_RESOURCE;
555 sccb->ccb_h.status |= CAM_RELEASE_SIMQ;
577 sccb->ccb_h.status |= CAM_RELEASE_SIMQ;
556 isp->isp_osinfo.simqfrozen = 0;
578 xpt_release_simq(isp->isp_sim, 1);
557 }
558 sccb->ccb_h.status &= ~CAM_SIM_QUEUED;
559 if (CAM_DEBUGGED(sccb->ccb_h.path, ISPDDB) &&
560 (sccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
561 xpt_print_path(sccb->ccb_h.path);
562 printf("cam completion status 0x%x\n", sccb->ccb_h.status);
563 }
564 xpt_done((union ccb *) sccb);
565}
566
567int
568isp_async(isp, cmd, arg)
569 struct ispsoftc *isp;
570 ispasync_t cmd;
571 void *arg;
572{
573 int rv = 0;
574 switch (cmd) {
579 }
580 sccb->ccb_h.status &= ~CAM_SIM_QUEUED;
581 if (CAM_DEBUGGED(sccb->ccb_h.path, ISPDDB) &&
582 (sccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
583 xpt_print_path(sccb->ccb_h.path);
584 printf("cam completion status 0x%x\n", sccb->ccb_h.status);
585 }
586 xpt_done((union ccb *) sccb);
587}
588
589int
590isp_async(isp, cmd, arg)
591 struct ispsoftc *isp;
592 ispasync_t cmd;
593 void *arg;
594{
595 int rv = 0;
596 switch (cmd) {
575 case ISPASYNC_LOOP_DOWN:
576 if (isp->isp_path) {
577 /*
578 * We can get multiple LOOP downs, so only count one.
579 */
580 if (isp->isp_osinfo.simqfrozen == 0) {
581 xpt_freeze_simq(isp->isp_sim, 1);
582 isp->isp_osinfo.simqfrozen = 1;
583 xpt_print_path(isp->isp_path);
584 printf("freezing SIMQ until loop comes up\n");
585 }
586 }
587 break;
588 case ISPASYNC_LOOP_UP:
589 if (isp->isp_path) {
590 xpt_print_path(isp->isp_path);
591 if (isp->isp_osinfo.simqfrozen) {
592 isp->isp_osinfo.simqfrozen = 0;
593 printf("releasing frozen SIMQ\n");
594 xpt_release_simq(isp->isp_sim, 1);
595 }
596 }
597 break;
598 case ISPASYNC_NEW_TGT_PARAMS:
599 if (isp->isp_type & ISP_HA_SCSI) {
600 int flags, tgt;
601 sdparam *sdp = isp->isp_param;
602 struct ccb_trans_settings neg;
603 struct cam_path *tmppath;
604
605 tgt = *((int *)arg);

--- 27 unchanged lines hidden (view full) ---

633 IDPRINTF(3, ("%s: new params target %d period %d "
634 "offset %d flags 0x%x\n", isp->isp_name, tgt,
635 neg.sync_period, neg.sync_offset, flags));
636 xpt_setup_ccb(&neg.ccb_h, tmppath, 1);
637 xpt_async(AC_TRANSFER_NEG, tmppath, &neg);
638 xpt_free_path(tmppath);
639 }
640 break;
597 case ISPASYNC_NEW_TGT_PARAMS:
598 if (isp->isp_type & ISP_HA_SCSI) {
599 int flags, tgt;
600 sdparam *sdp = isp->isp_param;
601 struct ccb_trans_settings neg;
602 struct cam_path *tmppath;
603
604 tgt = *((int *)arg);

--- 27 unchanged lines hidden (view full) ---

632 IDPRINTF(3, ("%s: new params target %d period %d "
633 "offset %d flags 0x%x\n", isp->isp_name, tgt,
634 neg.sync_period, neg.sync_offset, flags));
635 xpt_setup_ccb(&neg.ccb_h, tmppath, 1);
636 xpt_async(AC_TRANSFER_NEG, tmppath, &neg);
637 xpt_free_path(tmppath);
638 }
639 break;
640 case ISPASYNC_BUS_RESET:
641 printf("%s: SCSI bus reset detected\n", isp->isp_name);
642 if (isp->isp_path) {
643 xpt_async(AC_BUS_RESET, isp->isp_path, NULL);
644 }
645 break;
646 case ISPASYNC_LOOP_DOWN:
647 if (isp->isp_path) {
648 /*
649 * We can get multiple LOOP downs, so only count one.
650 */
651 if (!(isp->isp_osinfo.simqfrozen & SIMQFRZ_LOOPDOWN)) {
652 xpt_freeze_simq(isp->isp_sim, 1);
653 isp->isp_osinfo.simqfrozen |= SIMQFRZ_LOOPDOWN;
654 printf("%s: Loop DOWN- freezing SIMQ until Loop"
655 " comes up\n", isp->isp_name);
656 }
657 } else {
658 printf("%s: Loop DOWN\n", isp->isp_name);
659 }
660 break;
661 case ISPASYNC_LOOP_UP:
662 if (isp->isp_path) {
663 if (isp->isp_osinfo.simqfrozen & SIMQFRZ_LOOPDOWN) {
664 xpt_release_simq(isp->isp_sim, 1);
665 isp->isp_osinfo.simqfrozen &= ~SIMQFRZ_LOOPDOWN;
666 if (isp->isp_osinfo.simqfrozen) {
667 printf("%s: Loop UP- SIMQ still "
668 "frozen\n", isp->isp_name);
669 } else {
670 printf("%s: Loop UP-releasing frozen "
671 "SIMQ\n", isp->isp_name);
672 }
673 }
674 } else {
675 printf("%s: Loop UP\n", isp->isp_name);
676 }
677 break;
678 case ISPASYNC_PDB_CHANGE_COMPLETE:
679 if (isp->isp_type & ISP_HA_FC) {
680 int i;
681 static char *roles[4] = {
682 "No", "Target", "Initiator", "Target/Initiator"
683 };
684 for (i = 0; i < MAX_FC_TARG; i++) {
685 isp_pdb_t *pdbp =
686 &((fcparam *)isp->isp_param)->isp_pdb[i];
687 if (pdbp->pdb_options == INVALID_PDB_OPTIONS)
688 continue;
689 printf("%s: Loop ID %d, %s role\n",
690 isp->isp_name, pdbp->pdb_loopid,
691 roles[(pdbp->pdb_prli_svc3 >> 4) & 0x3]);
692 printf(" Node Address 0x%x WWN 0x"
693 "%02x%02x%02x%02x%02x%02x%02x%02x\n",
694 BITS2WORD(pdbp->pdb_portid_bits),
695 pdbp->pdb_portname[0], pdbp->pdb_portname[1],
696 pdbp->pdb_portname[2], pdbp->pdb_portname[3],
697 pdbp->pdb_portname[4], pdbp->pdb_portname[5],
698 pdbp->pdb_portname[6], pdbp->pdb_portname[7]);
699 if (pdbp->pdb_options & PDB_OPTIONS_ADISC)
700 printf(" Hard Address 0x%x WWN 0x"
701 "%02x%02x%02x%02x%02x%02x%02x%02x\n",
702 BITS2WORD(pdbp->pdb_hardaddr_bits),
703 pdbp->pdb_nodename[0],
704 pdbp->pdb_nodename[1],
705 pdbp->pdb_nodename[2],
706 pdbp->pdb_nodename[3],
707 pdbp->pdb_nodename[4],
708 pdbp->pdb_nodename[5],
709 pdbp->pdb_nodename[6],
710 pdbp->pdb_nodename[7]);
711 switch (pdbp->pdb_prli_svc3 & SVC3_ROLE_MASK) {
712 case SVC3_TGT_ROLE|SVC3_INI_ROLE:
713 printf(" Master State=%s, Slave State=%s\n",
714 isp2100_pdb_statename(pdbp->pdb_mstate),
715 isp2100_pdb_statename(pdbp->pdb_sstate));
716 break;
717 case SVC3_TGT_ROLE:
718 printf(" Master State=%s\n",
719 isp2100_pdb_statename(pdbp->pdb_mstate));
720 break;
721 case SVC3_INI_ROLE:
722 printf(" Slave State=%s\n",
723 isp2100_pdb_statename(pdbp->pdb_sstate));
724 break;
725 default:
726 break;
727 }
728 }
729 break;
730 }
731 case ISPASYNC_CHANGE_NOTIFY:
732 printf("%s: Name Server Database Changed\n", isp->isp_name);
733 break;
641 default:
642 break;
643 }
644 return (rv);
645}
646
647#else
648

--- 18 unchanged lines hidden (view full) ---

667isp_attach(struct ispsoftc *isp)
668{
669 struct scsibus_data *scbus;
670
671 scbus = scsi_alloc_bus();
672 if(!scbus) {
673 return;
674 }
734 default:
735 break;
736 }
737 return (rv);
738}
739
740#else
741

--- 18 unchanged lines hidden (view full) ---

760isp_attach(struct ispsoftc *isp)
761{
762 struct scsibus_data *scbus;
763
764 scbus = scsi_alloc_bus();
765 if(!scbus) {
766 return;
767 }
675 isp->isp_state = ISP_RUNSTATE;
768 if (isp->isp_state == ISP_INITSTATE)
769 isp->isp_state = ISP_RUNSTATE;
770
676 START_WATCHDOG(isp);
677
678 isp->isp_osinfo._link.adapter_unit = isp->isp_osinfo.unit;
679 isp->isp_osinfo._link.adapter_softc = isp;
680 isp->isp_osinfo._link.adapter = &isp_switch;
681 isp->isp_osinfo._link.device = &isp_dev;
682 isp->isp_osinfo._link.flags = 0;
683 if (isp->isp_type & ISP_HA_FC) {

--- 47 unchanged lines hidden (view full) ---

731 */
732 return (2);
733}
734
735static int
736ispcmd(ISP_SCSI_XFER_T *xs)
737{
738 struct ispsoftc *isp;
771 START_WATCHDOG(isp);
772
773 isp->isp_osinfo._link.adapter_unit = isp->isp_osinfo.unit;
774 isp->isp_osinfo._link.adapter_softc = isp;
775 isp->isp_osinfo._link.adapter = &isp_switch;
776 isp->isp_osinfo._link.device = &isp_dev;
777 isp->isp_osinfo._link.flags = 0;
778 if (isp->isp_type & ISP_HA_FC) {

--- 47 unchanged lines hidden (view full) ---

826 */
827 return (2);
828}
829
830static int
831ispcmd(ISP_SCSI_XFER_T *xs)
832{
833 struct ispsoftc *isp;
739 int r;
740 ISP_LOCKVAL_DECL;
834 int r, s;
741
742 isp = XS_ISP(xs);
835
836 isp = XS_ISP(xs);
743 ISP_LOCK;
837 s = splbio();
838 DISABLE_INTS(isp);
839 if (isp->isp_state != ISP_RUNSTATE) {
840 isp_init(isp);
841 if (isp->isp_state != ISP_INITSTATE) {
842 ENABLE_INTS(isp);
843 (void) splx(s);
844 XS_SETERR(xs, HBA_BOTCH);
845 return (CMD_COMPLETE);
846 }
847 isp_state = ISP_RUNSTATE;
848 }
744 r = ispscsicmd(xs);
849 r = ispscsicmd(xs);
850 ENABLE_INTS(isp);
745 if (r != CMD_QUEUED || (xs->flags & SCSI_NOMASK) == 0) {
851 if (r != CMD_QUEUED || (xs->flags & SCSI_NOMASK) == 0) {
746 ISP_UNLOCK;
852 (void) splx(s);
747 return (r);
748 }
749
750 /*
751 * If we can't use interrupts, poll on completion.
752 */
753 if (isp_poll(isp, xs, XS_TIME(xs))) {
754 /*

--- 5 unchanged lines hidden (view full) ---

760 if (isp->isp_nactive < 0)
761 isp->isp_nactive = 0;
762 if (XS_NOERR(xs)) {
763 isp_lostcmd(isp, xs);
764 XS_SETERR(xs, HBA_BOTCH);
765 }
766 }
767 }
853 return (r);
854 }
855
856 /*
857 * If we can't use interrupts, poll on completion.
858 */
859 if (isp_poll(isp, xs, XS_TIME(xs))) {
860 /*

--- 5 unchanged lines hidden (view full) ---

866 if (isp->isp_nactive < 0)
867 isp->isp_nactive = 0;
868 if (XS_NOERR(xs)) {
869 isp_lostcmd(isp, xs);
870 XS_SETERR(xs, HBA_BOTCH);
871 }
872 }
873 }
768 ISP_UNLOCK;
874 (void) splx(s);
769 return (CMD_COMPLETE);
770}
771
772static int
773isp_poll(struct ispsoftc *isp, ISP_SCSI_XFER_T *xs, int mswait)
774{
775
776 while (mswait) {

--- 91 unchanged lines hidden (view full) ---

868 isp->isp_name, tgt, 1000 / ns,
869 sdp->isp_devparam[tgt].sync_offset, wt);
870 } else {
871 printf("%s: Target %d Async Mode%s",
872 isp->isp_name, tgt, wt);
873 }
874 }
875 break;
875 return (CMD_COMPLETE);
876}
877
878static int
879isp_poll(struct ispsoftc *isp, ISP_SCSI_XFER_T *xs, int mswait)
880{
881
882 while (mswait) {

--- 91 unchanged lines hidden (view full) ---

974 isp->isp_name, tgt, 1000 / ns,
975 sdp->isp_devparam[tgt].sync_offset, wt);
976 } else {
977 printf("%s: Target %d Async Mode%s",
978 isp->isp_name, tgt, wt);
979 }
980 }
981 break;
982 case ISPASYNC_BUS_RESET:
983 printf("%s: SCSI bus reset detected\n", isp->isp_name);
984 break;
985 case ISPASYNC_LOOP_DOWN:
986 printf("%s: Loop DOWN\n", isp->isp_name);
987 break;
988 case ISPASYNC_LOOP_UP:
989 printf("%s: Loop UP\n", isp->isp_name);
990 break;
991 case ISPASYNC_PDB_CHANGE_COMPLETE:
992 if (isp->isp_type & ISP_HA_FC) {
993 int i;
994 static char *roles[4] = {
995 "No", "Target", "Initiator", "Target/Initiator"
996 };
997 for (i = 0 i < MAX_FC_TARG; i++) {
998 isp_pdb_t *pdbp =
999 &((fcparam *)isp->isp_param)->isp_pdb[i];
1000 if (pdbp->pdb_options == INVALID_PDB_OPTIONS)
1001 continue;
1002 printf("%s: Loop ID %d, %s role\n",
1003 isp->isp_name, pdbp->pdb_loopid,
1004 roles[(pdbp->pdb_prli_svc3 >> 4) & 0x3]);
1005 printf(" Node Address 0x%x WWN 0x"
1006 "%02x%02x%02x%02x%02x%02x%02x%02x\n",
1007 BITS2WORD(pdbp->pdb_portid_bits),
1008 pdbp->pdb_portname[0], pdbp->pdb_portname[1],
1009 pdbp->pdb_portname[2], pdbp->pdb_portname[3],
1010 pdbp->pdb_portname[4], pdbp->pdb_portname[5],
1011 pdbp->pdb_portname[6], pdbp->pdb_portname[7]);
1012 if (pdbp->pdb_options & PDB_OPTIONS_ADISC)
1013 printf(" Hard Address 0x%x WWN 0x"
1014 "%02x%02x%02x%02x%02x%02x%02x%02x\n",
1015 BITS2WORD(pdbp->pdb_hardaddr_bits),
1016 pdbp->pdb_nodename[0],
1017 pdbp->pdb_nodename[1],
1018 pdbp->pdb_nodename[2],
1019 pdbp->pdb_nodename[3],
1020 pdbp->pdb_nodename[4],
1021 pdbp->pdb_nodename[5],
1022 pdbp->pdb_nodename[6],
1023 pdbp->pdb_nodename[7]);
1024 switch (pdbp->pdb_prli_svc3 & SVC3_ROLE_MASK) {
1025 case SVC3_TGT_ROLE|SVC3_INI_ROLE:
1026 printf(" Master State=%s, Slave State=%s\n",
1027 isp2100_pdb_statename(pdbp->pdb_mstate),
1028 isp2100_pdb_statename(pdbp->pdb_sstate));
1029 break;
1030 case SVC3_TGT_ROLE:
1031 printf(" Master State=%s\n",
1032 isp2100_pdb_statename(pdbp->pdb_mstate));
1033 break;
1034 case SVC3_INI_ROLE:
1035 printf(" Slave State=%s\n",
1036 isp2100_pdb_statename(pdbp->pdb_sstate));
1037 break;
1038 default:
1039 break;
1040 }
1041 }
1042 break;
1043 }
1044 case ISPASYNC_CHANGE_NOTIFY:
1045 printf("%s: Name Server Database Changed\n", isp->isp_name);
1046 break;
876 default:
877 break;
878 }
879 return (0);
880}
881#endif
882
883/*

--- 26 unchanged lines hidden ---
1047 default:
1048 break;
1049 }
1050 return (0);
1051}
1052#endif
1053
1054/*

--- 26 unchanged lines hidden ---