1 /*-----------------------------------------------------------------------------
4 * Copyright (C) 2007 One Stop Systems, Inc.
5 * Copyright (C) 2002-2006 SBE, Inc.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * For further information, contact via email: support@onestopsystems.com
18 * One Stop Systems, Inc. Escondido, California U.S.A.
19 *-----------------------------------------------------------------------------
22 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
24 #include <linux/types.h>
25 #include "pmcc4_sysdep.h"
26 #include <linux/errno.h>
27 #include <linux/kernel.h>
28 #include <linux/sched.h> /* include for timer */
29 #include <linux/timer.h> /* include for timer */
30 #include <linux/hdlc.h>
33 #include "sbecom_inline_linux.h"
35 #include "pmcc4_private.h"
37 #include "pmcc4_ioctls.h"
42 #define KERN_WARN KERN_WARNING
44 /* forward references */
45 status_t c4_wk_chan_init (mpi_t *, mch_t *);
46 void c4_wq_port_cleanup (mpi_t *);
47 status_t c4_wq_port_init (mpi_t *);
49 int c4_loop_port (ci_t *, int, u_int8_t);
50 status_t c4_set_port (ci_t *, int);
51 status_t musycc_chan_down (ci_t *, int);
53 u_int32_t musycc_chan_proto (int);
54 status_t musycc_dump_ring (ci_t *, unsigned int);
55 status_t __init musycc_init (ci_t *);
56 void musycc_init_mdt (mpi_t *);
57 void musycc_serv_req (mpi_t *, u_int32_t);
58 void musycc_update_timeslots (mpi_t *);
60 extern void musycc_update_tx_thp (mch_t *);
61 extern int cxt1e1_log_level;
62 extern int cxt1e1_max_mru;
63 extern int cxt1e1_max_mtu;
64 extern int max_rxdesc_used, max_rxdesc_default;
65 extern int max_txdesc_used, max_txdesc_default;
67 #if defined (__powerpc__)
68 extern void *memset (void *s, int c, size_t n);
72 int drvr_state = SBE_DRVR_INIT;
74 ci_t *CI; /* dummy pointer to board ZEROE's data -
79 sbecom_set_loglevel (int d)
82 * The code within the following -if- clause is a backdoor debug facility
83 * which can be used to display the state of a board's channel.
87 unsigned int channum = d - (LOG_DEBUG + 1); /* convert to ZERO
90 (void) musycc_dump_ring ((ci_t *) CI, channum); /* CI implies support
94 if (cxt1e1_log_level != d)
96 pr_info("log level changed from %d to %d\n", cxt1e1_log_level, d);
97 cxt1e1_log_level = d; /* set new */
99 pr_info("log level is %d\n", cxt1e1_log_level);
105 c4_find_chan (int channum)
111 for (ci = c4_list; ci; ci = ci->next)
112 for (portnum = 0; portnum < ci->max_port; portnum++)
113 for (gchan = 0; gchan < MUSYCC_NCHANS; gchan++)
115 if ((ch = ci->port[portnum].chan[gchan]))
117 if ((ch->state != UNASSIGNED) &&
118 (ch->channum == channum))
132 pr_warning("c4_new() entered, ci needs %u.\n",
133 (unsigned int) sizeof (ci_t));
136 ci = (ci_t *) OS_kmalloc (sizeof (ci_t));
140 ci->state = C_INIT; /* mark as hardware not available */
143 ci->brdno = ci->next ? ci->next->brdno + 1 : 0;
145 pr_warning("failed CI malloc, size %u.\n",
146 (unsigned int) sizeof (ci_t));
149 CI = ci; /* DEBUG, only board 0 usage */
155 * Check port state and set LED states using watchdog or ioctl...
156 * also check for in-band SF loopback commands (& cause results if they are there)
158 * Alarm function depends on comet bits indicating change in
159 * link status (linkMask) to keep the link status indication straight.
161 * Indications are only LED and system log -- except when ioctl is invoked.
163 * "alarmed" record (a.k.a. copyVal, in some cases below) decodes as:
165 * RMAI (E1 only) 0x100
168 * link returned 0x20 (link was down, now it's back and 'port get' hasn't run)
169 * change in LED 0x10 (update LED register because value has changed)
175 * note "link has returned" indication is reset on read
176 * (e.g. by use of the c4_control port get command)
179 #define sbeLinkMask 0x41 /* change in signal status (lost/recovered) +
181 #define sbeLinkChange 0x40
182 #define sbeLinkDown 0x01
183 #define sbeAlarmsMask 0x07 /* red / yellow / blue alarm conditions */
184 #define sbeE1AlarmsMask 0x107 /* alarm conditions */
186 #define COMET_LBCMD_READ 0x80 /* read only (do not set, return read value) */
189 checkPorts (ci_t *ci)
191 #ifndef CONFIG_SBE_PMCC4_NCOMM
193 * PORT POINT - NCOMM needs to avoid this code since the polling of
194 * alarms conflicts with NCOMM's interrupt servicing implementation.
198 volatile u_int32_t value;
199 u_int32_t copyVal, LEDval;
204 for (portnum = 0; portnum < ci->max_port; portnum++)
206 copyVal = 0x12f & (ci->alarmed[portnum]); /* port's alarm record */
207 comet = ci->port[portnum].cometbase;
208 value = pci_read_32 ((u_int32_t *) &comet->cdrc_ists) & sbeLinkMask; /* link loss reg */
210 if (value & sbeLinkChange) /* is there a change in the link stuff */
212 /* if there's been a change (above) and yet it's the same (below) */
213 if (!(((copyVal >> 3) & sbeLinkDown) ^ (value & sbeLinkDown)))
215 if (value & sbeLinkDown)
216 pr_warning("%s: Port %d momentarily recovered.\n",
217 ci->devname, portnum);
219 pr_warning("%s: Warning: Port %d link was briefly down.\n",
220 ci->devname, portnum);
221 } else if (value & sbeLinkDown)
222 pr_warning("%s: Warning: Port %d link is down.\n",
223 ci->devname, portnum);
226 pr_warning("%s: Port %d link has recovered.\n",
227 ci->devname, portnum);
228 copyVal |= 0x20; /* record link transition to up */
230 copyVal |= 0x10; /* change (link) --> update LEDs */
232 copyVal &= 0x137; /* clear LED & link old history bits &
234 if (value & sbeLinkDown)
235 copyVal |= 0x08; /* record link status (now) */
237 { /* if link is up, do this */
238 copyVal |= 0x40; /* LED indicate link is up */
239 /* Alarm things & the like ... first if E1, then if T1 */
240 if (IS_FRAME_ANY_E1 (ci->port[portnum].p.port_mode))
243 * first check Codeword (SaX) changes & CRC and
244 * sub-multi-frame errors
247 * note these errors are printed every time they are detected
250 value = pci_read_32 ((u_int32_t *) &comet->e1_frmr_nat_ists); /* codeword */
252 { /* if errors (crc or smf only) */
254 pr_warning("%s: E1 Port %d Codeword Sa4 change detected.\n",
255 ci->devname, portnum);
257 pr_warning("%s: E1 Port %d Codeword Sa5 change detected.\n",
258 ci->devname, portnum);
260 pr_warning("%s: E1 Port %d Codeword Sa6 change detected.\n",
261 ci->devname, portnum);
263 pr_warning("%s: E1 Port %d Codeword Sa7 change detected.\n",
264 ci->devname, portnum);
266 pr_warning("%s: E1 Port %d Codeword Sa8 change detected.\n",
267 ci->devname, portnum);
269 value = pci_read_32 ((u_int32_t *) &comet->e1_frmr_mists); /* crc & smf */
271 { /* if errors (crc or smf only) */
272 if (value & sbeE1CRC)
273 pr_warning("%s: E1 Port %d CRC-4 error(s) detected.\n",
274 ci->devname, portnum);
275 if (value & sbeE1errSMF) /* error in sub-multiframe */
276 pr_warning("%s: E1 Port %d received errored SMF.\n",
277 ci->devname, portnum);
279 value = pci_read_32 ((u_int32_t *) &comet->e1_frmr_masts) & 0xcc; /* alarms */
281 * pack alarms together (bitmiser), and construct similar to
284 /* RAI,RMAI,.,.,LOF,AIS,.,. ==> RMAI,.,.,.,.,.,RAI,LOF,AIS */
286 value = (value >> 2);
290 value |= 0x40; /* RAI */
292 value |= 0x100; /* RMAI */
294 } /* finished packing alarm in handy order */
295 if (value != (copyVal & sbeE1AlarmsMask))
296 { /* if alarms changed */
297 copyVal |= 0x10;/* change LED status */
298 if ((copyVal & sbeRedAlm) && !(value & sbeRedAlm))
300 copyVal &= ~sbeRedAlm;
301 pr_warning("%s: E1 Port %d LOF alarm ended.\n",
302 ci->devname, portnum);
303 } else if (!(copyVal & sbeRedAlm) && (value & sbeRedAlm))
305 copyVal |= sbeRedAlm;
306 pr_warning("%s: E1 Warning: Port %d LOF alarm.\n",
307 ci->devname, portnum);
308 } else if ((copyVal & sbeYelAlm) && !(value & sbeYelAlm))
310 copyVal &= ~sbeYelAlm;
311 pr_warning("%s: E1 Port %d RAI alarm ended.\n",
312 ci->devname, portnum);
313 } else if (!(copyVal & sbeYelAlm) && (value & sbeYelAlm))
315 copyVal |= sbeYelAlm;
316 pr_warning("%s: E1 Warning: Port %d RAI alarm.\n",
317 ci->devname, portnum);
318 } else if ((copyVal & sbeE1RMAI) && !(value & sbeE1RMAI))
320 copyVal &= ~sbeE1RMAI;
321 pr_warning("%s: E1 Port %d RMAI alarm ended.\n",
322 ci->devname, portnum);
323 } else if (!(copyVal & sbeE1RMAI) && (value & sbeE1RMAI))
325 copyVal |= sbeE1RMAI;
326 pr_warning("%s: E1 Warning: Port %d RMAI alarm.\n",
327 ci->devname, portnum);
328 } else if ((copyVal & sbeAISAlm) && !(value & sbeAISAlm))
330 copyVal &= ~sbeAISAlm;
331 pr_warning("%s: E1 Port %d AIS alarm ended.\n",
332 ci->devname, portnum);
333 } else if (!(copyVal & sbeAISAlm) && (value & sbeAISAlm))
335 copyVal |= sbeAISAlm;
336 pr_warning("%s: E1 Warning: Port %d AIS alarm.\n",
337 ci->devname, portnum);
340 /* end of E1 alarm code */
343 value = pci_read_32 ((u_int32_t *) &comet->t1_almi_ists); /* alarms */
344 value &= sbeAlarmsMask;
345 if (value != (copyVal & sbeAlarmsMask))
346 { /* if alarms changed */
347 copyVal |= 0x10;/* change LED status */
348 if ((copyVal & sbeRedAlm) && !(value & sbeRedAlm))
350 copyVal &= ~sbeRedAlm;
351 pr_warning("%s: Port %d red alarm ended.\n",
352 ci->devname, portnum);
353 } else if (!(copyVal & sbeRedAlm) && (value & sbeRedAlm))
355 copyVal |= sbeRedAlm;
356 pr_warning("%s: Warning: Port %d red alarm.\n",
357 ci->devname, portnum);
358 } else if ((copyVal & sbeYelAlm) && !(value & sbeYelAlm))
360 copyVal &= ~sbeYelAlm;
361 pr_warning("%s: Port %d yellow (RAI) alarm ended.\n",
362 ci->devname, portnum);
363 } else if (!(copyVal & sbeYelAlm) && (value & sbeYelAlm))
365 copyVal |= sbeYelAlm;
366 pr_warning("%s: Warning: Port %d yellow (RAI) alarm.\n",
367 ci->devname, portnum);
368 } else if ((copyVal & sbeAISAlm) && !(value & sbeAISAlm))
370 copyVal &= ~sbeAISAlm;
371 pr_warning("%s: Port %d blue (AIS) alarm ended.\n",
372 ci->devname, portnum);
373 } else if (!(copyVal & sbeAISAlm) && (value & sbeAISAlm))
375 copyVal |= sbeAISAlm;
376 pr_warning("%s: Warning: Port %d blue (AIS) alarm.\n",
377 ci->devname, portnum);
380 } /* end T1 mode alarm checks */
382 if (copyVal & sbeAlarmsMask)
383 copyVal |= 0x80; /* if alarm turn yel LED on */
385 LEDval |= 0x100; /* tag if LED values have changed */
386 LEDval |= ((copyVal & 0xc0) >> (6 - (portnum * 2)));
388 ci->alarmed[portnum] &= 0xfffff000; /* out with the old (it's fff
390 ci->alarmed[portnum] |= (copyVal); /* in with the new */
393 * enough with the alarms and LED's, now let's check for loopback
397 if (IS_FRAME_ANY_T1 (ci->port[portnum].p.port_mode))
400 * begin in-band (SF) loopback code detection -- start by reading
403 value = pci_read_32 ((u_int32_t *) &comet->ibcd_ies); /* detect reg. */
404 value &= 0x3; /* trim to handy bits */
406 { /* activate loopback (sets for deactivate
408 copyVal = c4_loop_port (ci, portnum, COMET_LBCMD_READ); /* read line loopback
410 if (copyVal != COMET_MDIAG_LINELB) /* don't do it again if
411 * already in that mode */
412 c4_loop_port (ci, portnum, COMET_MDIAG_LINELB); /* put port in line
416 { /* deactivate loopback (sets for activate
418 copyVal = c4_loop_port (ci, portnum, COMET_LBCMD_READ); /* read line loopback
420 if (copyVal != COMET_MDIAG_LBOFF) /* don't do it again if
421 * already in that mode */
422 c4_loop_port (ci, portnum, COMET_MDIAG_LBOFF); /* take port out of any
426 if (IS_FRAME_ANY_T1ESF (ci->port[portnum].p.port_mode))
427 { /* if a T1 ESF mode */
428 /* begin ESF loopback code */
429 value = pci_read_32 ((u_int32_t *) &comet->t1_rboc_sts) & 0x3f; /* read command */
431 c4_loop_port (ci, portnum, COMET_MDIAG_LINELB); /* put port in line
434 c4_loop_port (ci, portnum, COMET_MDIAG_PAYLB); /* put port in payload
436 if ((value == 0x1c) || (value == 0x19) || (value == 0x12))
437 c4_loop_port (ci, portnum, COMET_MDIAG_LBOFF); /* take port out of any
439 if (cxt1e1_log_level >= LOG_DEBUG)
441 pr_warning("%s: BOC value = %x on Port %d\n",
442 ci->devname, value, portnum);
443 /* end ESF loopback code */
447 /* if something is new, update LED's */
449 pci_write_32 ((u_int32_t *) &ci->cpldbase->leds, LEDval & 0xff);
450 #endif /*** CONFIG_SBE_PMCC4_NCOMM ***/
455 c4_watchdog (ci_t *ci)
457 if (drvr_state != SBE_DRVR_AVAILABLE)
459 if (cxt1e1_log_level >= LOG_MONITOR)
460 pr_info("drvr not available (%x)\n", drvr_state);
479 next = ci->next; /* protect <next> from upcoming <free> */
480 pci_write_32 ((u_int32_t *) &ci->cpldbase->leds, PMCC4_CPLD_LED_OFF);
481 for (portnum = 0; portnum < ci->max_port; portnum++)
483 pi = &ci->port[portnum];
484 c4_wq_port_cleanup (pi);
485 for (j = 0; j < MUSYCC_NCHANS; j++)
488 OS_kfree (pi->chan[j]); /* free mch_t struct */
490 OS_kfree (pi->regram_saved);
492 OS_kfree (ci->iqd_p_saved);
494 ci = next; /* cleanup next board, if any */
500 * This function issues a write to all comet chips and expects the same data
501 * to be returned from the subsequent read. This determines the board build
502 * to be a 1-port, 2-port, or 4-port build. The value returned represents a
503 * bit-mask of the found ports. Only certain configurations are considered
504 * VALID or LEGAL builds.
508 c4_get_portcfg (ci_t *ci)
512 u_int32_t wdata, rdata;
514 wdata = COMET_MDIAG_LBOFF; /* take port out of any loopback mode */
517 for (portnum = 0; portnum < MUSYCC_NPORTS; portnum++)
519 comet = ci->port[portnum].cometbase;
520 pci_write_32 ((u_int32_t *) &comet->mdiag, wdata);
521 rdata = pci_read_32 ((u_int32_t *) &comet->mdiag) & COMET_MDIAG_LBMASK;
523 mask |= 1 << portnum;
529 /* nothing herein should generate interrupts */
532 c4_init (ci_t *ci, u_char *func0, u_char *func1)
536 static u_int32_t count = 0;
541 ci->intlog.this_status_new = 0;
542 atomic_set (&ci->bh_pending, 0);
544 ci->reg = (struct musycc_globalr *) func0;
545 ci->eeprombase = (u_int32_t *) (func1 + EEPROM_OFFSET);
546 ci->cpldbase = (c4cpld_t *) ((u_int32_t *) (func1 + ISPLD_OFFSET));
548 /*** PORT POINT - the following is the first access of any type to the hardware ***/
549 #ifdef CONFIG_SBE_PMCC4_NCOMM
550 /* NCOMM driver uses INTB interrupt to monitor CPLD register */
551 pci_write_32 ((u_int32_t *) &ci->reg->glcd, GCD_MAGIC);
553 /* standard driver POLLS for INTB via CPLD register */
554 pci_write_32 ((u_int32_t *) &ci->reg->glcd, GCD_MAGIC | MUSYCC_GCD_INTB_DISABLE);
560 /* need comet addresses available for determination of hardware build */
561 for (portnum = 0; portnum < MUSYCC_NPORTS; portnum++)
563 pi = &ci->port[portnum];
564 pi->cometbase = (comet_t *) ((u_int32_t *) (func1 + COMET_OFFSET (portnum)));
565 pi->reg = (struct musycc_globalr *) ((u_char *) ci->reg + (portnum * 0x800));
566 pi->portnum = portnum;
567 pi->p.portnum = portnum;
570 pr_info("Comet-%d: addr = %p\n", portnum, pi->cometbase);
573 pmsk = c4_get_portcfg (ci);
583 case 0x7: /* not built, but could be... */
592 pr_warning("%s: illegal port configuration (%x)\n",
594 return SBE_DRVR_FAIL;
597 pr_info(">> %s: c4_get_build - pmsk %x max_port %x\n",
598 ci->devname, pmsk, ci->max_port);
602 for (portnum = 0; portnum < ci->max_port; portnum++)
604 pi = &ci->port[portnum];
606 pi->sr_last = 0xffffffff;
607 pi->p.port_mode = CFG_FRAME_SF; /* T1 B8ZS, the default */
608 pi->p.portP = (CFG_CLK_PORT_EXTERNAL | CFG_LBO_LH0); /* T1 defaults */
610 OS_sem_init (&pi->sr_sem_busy, SEM_AVAILABLE);
611 OS_sem_init (&pi->sr_sem_wait, SEM_TAKEN);
613 for (j = 0; j < 32; j++)
616 pi->tsm[j] = 0; /* no assignments, all available */
619 /* allocate channel structures for this port */
620 for (j = 0; j < MUSYCC_NCHANS; j++)
622 ch = OS_kmalloc (sizeof (mch_t));
626 ch->state = UNASSIGNED;
628 ch->gchan = (-1); /* channel assignment not yet known */
629 ch->channum = (-1); /* channel assignment not yet known */
630 ch->p.card = ci->brdno;
631 ch->p.port = portnum;
632 ch->p.channum = (-1); /* channel assignment not yet known */
633 ch->p.mode_56k = 0; /* default is 64kbps mode */
636 pr_warning("failed mch_t malloc, port %d channel %d size %u.\n",
637 portnum, j, (unsigned int) sizeof (mch_t));
646 * Set LEDs through their paces to supply visual proof that LEDs are
647 * functional and not burnt out nor broken.
649 * YELLOW + GREEN -> OFF.
652 pci_write_32 ((u_int32_t *) &ci->cpldbase->leds,
653 PMCC4_CPLD_LED_GREEN | PMCC4_CPLD_LED_YELLOW);
654 OS_uwait (750000, "leds");
655 pci_write_32 ((u_int32_t *) &ci->cpldbase->leds, PMCC4_CPLD_LED_OFF);
658 OS_init_watchdog (&ci->wd, (void (*) (void *)) c4_watchdog, ci, WATCHDOG_TIMEOUT);
659 return SBE_DRVR_SUCCESS;
663 /* better be fully setup to handle interrupts when you call this */
670 /* PORT POINT: this routine generates first interrupt */
671 if ((ret = musycc_init (ci)) != SBE_DRVR_SUCCESS)
675 ci->p.framing_type = FRAMING_CBP;
676 ci->p.h110enable = 1;
682 ci->p.clock = 0; /* Use internal clocking until set to
684 c4_card_set_params (ci, &ci->p);
686 OS_start_watchdog (&ci->wd);
687 return SBE_DRVR_SUCCESS;
691 /* This function sets the loopback mode (or clears it, as the case may be). */
694 c4_loop_port (ci_t *ci, int portnum, u_int8_t cmd)
697 volatile u_int32_t loopValue;
699 comet = ci->port[portnum].cometbase;
700 loopValue = pci_read_32 ((u_int32_t *) &comet->mdiag) & COMET_MDIAG_LBMASK;
702 if (cmd & COMET_LBCMD_READ)
703 return loopValue; /* return the read value */
705 if (loopValue != cmd)
709 case COMET_MDIAG_LINELB:
710 /* set(SF)loopback down (turn off) code length to 6 bits */
711 pci_write_32 ((u_int32_t *) &comet->ibcd_cfg, 0x05);
713 case COMET_MDIAG_LBOFF:
714 /* set (SF) loopback up (turn on) code length to 5 bits */
715 pci_write_32 ((u_int32_t *) &comet->ibcd_cfg, 0x00);
719 pci_write_32 ((u_int32_t *) &comet->mdiag, cmd);
720 if (cxt1e1_log_level >= LOG_WARN)
721 pr_info("%s: loopback mode changed to %2x from %2x on Port %d\n",
722 ci->devname, cmd, loopValue, portnum);
723 loopValue = pci_read_32 ((u_int32_t *) &comet->mdiag) & COMET_MDIAG_LBMASK;
724 if (loopValue != cmd)
726 if (cxt1e1_log_level >= LOG_ERROR)
727 pr_info("%s: write to loop register failed, unknown state for Port %d\n",
728 ci->devname, portnum);
732 if (cxt1e1_log_level >= LOG_WARN)
733 pr_info("%s: loopback already in that mode (%2x)\n",
734 ci->devname, loopValue);
740 /* c4_frame_rw: read or write the comet register specified
741 * (modifies use of port_param to non-standard use of struct)
743 * pp.portnum (one guess)
744 * pp.port_mode offset of register
745 * pp.portP write (or not, i.e. read)
746 * pp.portStatus write value
748 * pp.portStatus also used to return read value
749 * pp.portP also used during write, to return old reg value
753 c4_frame_rw (ci_t *ci, struct sbecom_port_param *pp)
756 volatile u_int32_t data;
758 if (pp->portnum >= ci->max_port)/* sanity check */
761 comet = ci->port[pp->portnum].cometbase;
762 data = pci_read_32 ((u_int32_t *) comet + pp->port_mode) & 0xff;
765 { /* control says this is a register
767 if (pp->portStatus == data)
768 pr_info("%s: Port %d already that value! Writing again anyhow.\n",
769 ci->devname, pp->portnum);
770 pp->portP = (u_int8_t) data;
771 pci_write_32 ((u_int32_t *) comet + pp->port_mode,
773 data = pci_read_32 ((u_int32_t *) comet + pp->port_mode) & 0xff;
775 pp->portStatus = (u_int8_t) data;
780 /* c4_pld_rw: read or write the pld register specified
781 * (modifies use of port_param to non-standard use of struct)
783 * pp.port_mode offset of register
784 * pp.portP write (or not, i.e. read)
785 * pp.portStatus write value
787 * pp.portStatus also used to return read value
788 * pp.portP also used during write, to return old reg value
792 c4_pld_rw (ci_t *ci, struct sbecom_port_param *pp)
794 volatile u_int32_t *regaddr;
795 volatile u_int32_t data;
796 int regnum = pp->port_mode;
798 regaddr = (u_int32_t *) ci->cpldbase + regnum;
799 data = pci_read_32 ((u_int32_t *) regaddr) & 0xff;
802 { /* control says this is a register
804 pp->portP = (u_int8_t) data;
805 pci_write_32 ((u_int32_t *) regaddr, pp->portStatus);
806 data = pci_read_32 ((u_int32_t *) regaddr) & 0xff;
808 pp->portStatus = (u_int8_t) data;
812 /* c4_musycc_rw: read or write the musycc register specified
813 * (modifies use of port_param to non-standard use of struct)
815 * mcp.RWportnum port number and write indication bit (0x80)
816 * mcp.offset offset of register
817 * mcp.value write value going in and read value returning
820 /* PORT POINT: TX Subchannel Map registers are write-only
821 * areas within the MUSYCC and always return FF */
822 /* PORT POINT: regram and reg structures are minorly different and <offset> ioctl
823 * settings are aligned with the <reg> struct musycc_globalr{} usage.
824 * Also, regram is separately allocated shared memory, allocated for each port.
825 * PORT POINT: access offsets of 0x6000 for Msg Cfg Desc Tbl are for 4-port MUSYCC
826 * only. (An 8-port MUSYCC has 0x16000 offsets for accessing its upper 4 tables.)
830 c4_musycc_rw (ci_t *ci, struct c4_musycc_param *mcp)
833 volatile u_int32_t *dph; /* hardware implemented register */
834 u_int32_t *dpr = 0; /* RAM image of registers for group command
836 int offset = mcp->offset % 0x800; /* group relative address
837 * offset, mcp->portnum is
839 int portnum, ramread = 0;
840 volatile u_int32_t data;
843 * Sanity check hardware accessibility. The 0x6000 portion handles port
844 * numbers associated with Msg Descr Tbl decoding.
846 portnum = (mcp->offset % 0x6000) / 0x800;
847 if (portnum >= ci->max_port)
849 pi = &ci->port[portnum];
850 if (mcp->offset >= 0x6000)
851 offset += 0x6000; /* put back in MsgCfgDesc address offset */
852 dph = (u_int32_t *) ((u_long) pi->reg + offset);
854 /* read of TX are from RAM image, since hardware returns FF */
855 dpr = (u_int32_t *) ((u_long) pi->regram + offset);
856 if (mcp->offset < 0x6000) /* non MsgDesc Tbl accesses might require
859 if (offset >= 0x200 && offset < 0x380)
861 if (offset >= 0x10 && offset < 0x200)
864 /* read register from RAM or hardware, depending... */
868 //pr_info("c4_musycc_rw: RAM addr %p read data %x (portno %x offset %x RAM ramread %x)\n", dpr, data, portnum, offset, ramread); /* RLD DEBUG */
871 data = pci_read_32 ((u_int32_t *) dph);
872 //pr_info("c4_musycc_rw: REG addr %p read data %x (portno %x offset %x RAM ramread %x)\n", dph, data, portnum, offset, ramread); /* RLD DEBUG */
876 if (mcp->RWportnum & 0x80)
877 { /* control says this is a register
879 if (mcp->value == data)
880 pr_info("%s: musycc grp%d already that value! writing again anyhow.\n",
881 ci->devname, (mcp->RWportnum & 0x7));
882 /* write register RAM */
885 /* write hardware register */
886 pci_write_32 ((u_int32_t *) dph, mcp->value);
888 mcp->value = data; /* return the read value (or the 'old
889 * value', if is write) */
894 c4_get_port (ci_t *ci, int portnum)
896 if (portnum >= ci->max_port) /* sanity check */
899 SD_SEM_TAKE (&ci->sem_wdbusy, "_wd_"); /* only 1 thru here, per
902 ci->port[portnum].p.portStatus = (u_int8_t) ci->alarmed[portnum];
903 ci->alarmed[portnum] &= 0xdf;
904 SD_SEM_GIVE (&ci->sem_wdbusy); /* release per-board hold */
909 c4_set_port (ci_t *ci, int portnum)
912 struct sbecom_port_param *pp;
917 if (portnum >= ci->max_port) /* sanity check */
920 pi = &ci->port[portnum];
921 pp = &ci->port[portnum].p;
922 e1mode = IS_FRAME_ANY_E1 (pp->port_mode);
923 if (cxt1e1_log_level >= LOG_MONITOR2)
925 pr_info("%s: c4_set_port[%d]: entered, e1mode = %x, openchans %d.\n",
927 portnum, e1mode, pi->openchans);
930 return EBUSY; /* group needs initialization only for
931 * first channel of a group */
936 if ((ret = c4_wq_port_init (pi))) /* create/init
937 * workqueue_struct */
941 init_comet (ci, pi->cometbase, pp->port_mode, 1 /* clockmaster == true */ , pp->portP);
942 clck = pci_read_32 ((u_int32_t *) &ci->cpldbase->mclk) & PMCC4_CPLD_MCLK_MASK;
944 clck |= 1 << portnum;
946 clck &= 0xf ^ (1 << portnum);
948 pci_write_32 ((u_int32_t *) &ci->cpldbase->mclk, clck);
949 pci_write_32 ((u_int32_t *) &ci->cpldbase->mcsr, PMCC4_CPLD_MCSR_IND);
950 pci_write_32 ((u_int32_t *) &pi->reg->gbp, OS_vtophys (pi->regram));
952 /*********************************************************************/
953 /* ERRATA: If transparent mode is used, do not set OOFMP_DISABLE bit */
954 /*********************************************************************/
957 __constant_cpu_to_le32 (MUSYCC_GRCD_RX_ENABLE |
958 MUSYCC_GRCD_TX_ENABLE |
959 MUSYCC_GRCD_OOFMP_DISABLE |
960 MUSYCC_GRCD_SF_ALIGN | /* per MUSYCC ERRATA,
962 MUSYCC_GRCD_COFAIRQ_DISABLE |
963 MUSYCC_GRCD_MC_ENABLE |
964 (MUSYCC_GRCD_POLLTH_32 << MUSYCC_GRCD_POLLTH_SHIFT));
967 __constant_cpu_to_le32 ((e1mode ? 1 : 0) |
968 MUSYCC_PCD_TXSYNC_RISING |
969 MUSYCC_PCD_RXSYNC_RISING |
970 MUSYCC_PCD_RXDATA_RISING);
972 /* Message length descriptor */
973 pi->regram->mld = __constant_cpu_to_le32 (cxt1e1_max_mru | (cxt1e1_max_mru << 16));
976 for (i = 0; i < 32; i++)
979 /*** ASSIGNMENT NOTES: ***/
980 /*** Group's channel ZERO unavailable if E1. ***/
981 /*** Group's channel 16 unavailable if E1 CAS. ***/
982 /*** Group's channels 24-31 unavailable if T1. ***/
984 if (((i == 0) && e1mode) ||
985 ((i == 16) && ((pp->port_mode == CFG_FRAME_E1CRC_CAS) || (pp->port_mode == CFG_FRAME_E1CRC_CAS_AMI)))
986 || ((i > 23) && (!e1mode)))
988 pi->tsm[i] = 0xff; /* make tslot unavailable for this mode */
991 pi->tsm[i] = 0x00; /* make tslot available for assignment */
994 for (i = 0; i < MUSYCC_NCHANS; i++)
996 pi->regram->ttsm[i] = 0;
997 pi->regram->rtsm[i] = 0;
1000 musycc_serv_req (pi, SR_GROUP_INIT | SR_RX_DIRECTION);
1001 musycc_serv_req (pi, SR_GROUP_INIT | SR_TX_DIRECTION);
1003 musycc_init_mdt (pi);
1005 pi->group_is_set = 1;
1011 unsigned int max_int = 0;
1014 c4_new_chan (ci_t *ci, int portnum, int channum, void *user)
1020 if (c4_find_chan (channum)) /* a new channel shouldn't already exist */
1023 if (portnum >= ci->max_port) /* sanity check */
1026 pi = &(ci->port[portnum]);
1027 /* find any available channel within this port */
1028 for (gchan = 0; gchan < MUSYCC_NCHANS; gchan++)
1030 ch = pi->chan[gchan];
1031 if (ch && ch->state == UNASSIGNED) /* no assignment is good! */
1034 if (gchan == MUSYCC_NCHANS) /* exhausted table, all were assigned */
1039 /* NOTE: mch_t already cleared during OS_kmalloc() */
1043 ch->channum = channum; /* mark our channel assignment */
1044 ch->p.channum = channum;
1046 ch->p.card = ci->brdno;
1047 ch->p.port = portnum;
1049 ch->p.chan_mode = CFG_CH_PROTO_HDLC_FCS16;
1050 ch->p.idlecode = CFG_CH_FLAG_7E;
1051 ch->p.pad_fill_count = 2;
1052 spin_lock_init (&ch->ch_rxlock);
1053 spin_lock_init (&ch->ch_txlock);
1058 if ((ret = c4_wk_chan_init (pi, ch)))
1062 /* save off interface assignments which bound a board */
1063 if (ci->first_if == 0) /* first channel registered is assumed to
1064 * be the lowest channel */
1066 ci->first_if = ci->last_if = user;
1067 ci->first_channum = ci->last_channum = channum;
1071 if (ci->last_channum < channum) /* higher number channel found */
1072 ci->last_channum = channum;
1078 c4_del_chan (int channum)
1082 if (!(ch = c4_find_chan (channum)))
1084 if (ch->state == UP)
1085 musycc_chan_down ((ci_t *) 0, channum);
1086 ch->state = UNASSIGNED;
1089 ch->p.channum = (-1);
1094 c4_del_chan_stats (int channum)
1098 if (!(ch = c4_find_chan (channum)))
1101 memset (&ch->s, 0, sizeof (struct sbecom_chan_stats));
1107 c4_set_chan (int channum, struct sbecom_chan_param *p)
1112 if (!(ch = c4_find_chan (channum)))
1116 if (ch->p.card != p->card ||
1117 ch->p.port != p->port ||
1118 ch->p.channum != p->channum)
1122 if (!(ch->up->group_is_set))
1124 return EIO; /* out of order, SET_PORT command
1125 * required prior to first group's
1126 * SET_CHAN command */
1129 * Check for change of parameter settings in order to invoke closing of
1130 * channel prior to hardware poking.
1133 if (ch->p.status != p->status || ch->p.chan_mode != p->chan_mode ||
1134 ch->p.data_inv != p->data_inv || ch->p.intr_mask != p->intr_mask ||
1135 ch->txd_free < ch->txd_num) /* to clear out queued messages */
1136 x = 1; /* we have a change requested */
1137 for (i = 0; i < 32; i++) /* check for timeslot mapping changes */
1138 if (ch->p.bitmask[i] != p->bitmask[i])
1139 x = 1; /* we have a change requested */
1141 if (x && (ch->state == UP)) /* if change request and channel is
1146 if ((ret = musycc_chan_down ((ci_t *) 0, channum)))
1148 if ((ret = c4_chan_up (ch->up->up, channum)))
1150 sd_enable_xmit (ch->user); /* re-enable to catch flow controlled
1158 c4_get_chan (int channum, struct sbecom_chan_param *p)
1162 if (!(ch = c4_find_chan (channum)))
1169 c4_get_chan_stats (int channum, struct sbecom_chan_stats *p)
1173 if (!(ch = c4_find_chan (channum)))
1176 p->tx_pending = atomic_read (&ch->tx_pending);
1181 c4_fifo_alloc (mpi_t *pi, int chan, int *len)
1183 int i, l = 0, start = 0, max = 0, maxstart = 0;
1185 for (i = 0; i < 32; i++)
1187 if (pi->fifomap[i] != -1)
1204 if (cxt1e1_log_level >= LOG_WARN)
1205 pr_info("%s: wanted to allocate %d fifo space, but got only %d\n",
1206 pi->up->devname, *len, max);
1209 if (cxt1e1_log_level >= LOG_DEBUG)
1210 pr_info("%s: allocated %d fifo at %d for channel %d/%d\n",
1211 pi->up->devname, max, start, chan, pi->p.portnum);
1212 for (i = maxstart; i < (maxstart + max); i++)
1213 pi->fifomap[i] = chan;
1218 c4_fifo_free (mpi_t *pi, int chan)
1222 if (cxt1e1_log_level >= LOG_DEBUG)
1223 pr_info("%s: deallocated fifo for channel %d/%d\n",
1224 pi->up->devname, chan, pi->p.portnum);
1225 for (i = 0; i < 32; i++)
1226 if (pi->fifomap[i] == chan)
1227 pi->fifomap[i] = -1;
1232 c4_chan_up (ci_t *ci, int channum)
1238 int nts, nbuf, txnum, rxnum;
1239 int addr, i, j, gchan;
1240 u_int32_t tmp; /* for optimizing conversion across BE
1243 if (!(ch = c4_find_chan (channum)))
1245 if (ch->state == UP)
1247 if (cxt1e1_log_level >= LOG_MONITOR)
1248 pr_info("%s: channel already UP, graceful early exit\n",
1254 /* find nts ('number of timeslots') */
1256 for (i = 0; i < 32; i++)
1258 if (ch->p.bitmask[i] & pi->tsm[i])
1260 if (1 || cxt1e1_log_level >= LOG_WARN)
1262 pr_info("%s: c4_chan_up[%d] EINVAL (attempt to cfg in-use or unavailable TimeSlot[%d])\n",
1263 ci->devname, channum, i);
1264 pr_info("+ ask4 %x, currently %x\n",
1265 ch->p.bitmask[i], pi->tsm[i]);
1269 for (j = 0; j < 8; j++)
1270 if (ch->p.bitmask[i] & (1 << j))
1274 nbuf = nts / 8 ? nts / 8 : 1;
1277 /* if( cxt1e1_log_level >= LOG_WARN) */
1278 pr_info("%s: c4_chan_up[%d] ENOBUFS (no TimeSlots assigned)\n",
1279 ci->devname, channum);
1280 return ENOBUFS; /* this should not happen */
1282 addr = c4_fifo_alloc (pi, gchan, &nbuf);
1285 /* Setup the Time Slot Map */
1286 musycc_update_timeslots (pi);
1288 /* ch->tx_limit = nts; */
1289 ch->s.tx_pending = 0;
1291 /* Set Channel Configuration Descriptors */
1295 ccd = musycc_chan_proto (ch->p.chan_mode) << MUSYCC_CCD_PROTO_SHIFT;
1296 if ((ch->p.chan_mode == CFG_CH_PROTO_ISLP_MODE) ||
1297 (ch->p.chan_mode == CFG_CH_PROTO_TRANS))
1299 ccd |= MUSYCC_CCD_FCS_XFER; /* Non FSC Mode */
1301 ccd |= 2 << MUSYCC_CCD_MAX_LENGTH; /* Select second MTU */
1302 ccd |= ch->p.intr_mask;
1303 ccd |= addr << MUSYCC_CCD_BUFFER_LOC;
1304 if (ch->p.chan_mode == CFG_CH_PROTO_TRANS)
1305 ccd |= (nbuf) << MUSYCC_CCD_BUFFER_LENGTH;
1307 ccd |= (nbuf - 1) << MUSYCC_CCD_BUFFER_LENGTH;
1309 if (ch->p.data_inv & CFG_CH_DINV_TX)
1310 ccd |= MUSYCC_CCD_INVERT_DATA; /* Invert data */
1311 pi->regram->tcct[gchan] = cpu_to_le32 (ccd);
1313 if (ch->p.data_inv & CFG_CH_DINV_RX)
1314 ccd |= MUSYCC_CCD_INVERT_DATA; /* Invert data */
1316 ccd &= ~MUSYCC_CCD_INVERT_DATA; /* take away data inversion */
1317 pi->regram->rcct[gchan] = cpu_to_le32 (ccd);
1321 /* Reread the Channel Configuration Descriptor for this channel */
1322 musycc_serv_req (pi, SR_CHANNEL_CONFIG | SR_RX_DIRECTION | gchan);
1323 musycc_serv_req (pi, SR_CHANNEL_CONFIG | SR_TX_DIRECTION | gchan);
1326 * Figure out how many buffers we want. If the customer has changed from
1327 * the defaults, then use the changed values. Otherwise, use Transparent
1328 * mode's specific minimum default settings.
1330 if (ch->p.chan_mode == CFG_CH_PROTO_TRANS)
1332 if (max_rxdesc_used == max_rxdesc_default) /* use default setting */
1333 max_rxdesc_used = MUSYCC_RXDESC_TRANS;
1334 if (max_txdesc_used == max_txdesc_default) /* use default setting */
1335 max_txdesc_used = MUSYCC_TXDESC_TRANS;
1338 * Increase counts when hyperchanneling, since this implies an increase
1339 * in throughput per channel
1341 rxnum = max_rxdesc_used + (nts / 4);
1342 txnum = max_txdesc_used + (nts / 4);
1346 if (cxt1e1_log_level >= LOG_MONITOR)
1347 pr_info("%s: mode %x rxnum %d (rxused %d def %d) txnum %d (txused %d def %d)\n",
1348 ci->devname, ch->p.chan_mode,
1349 rxnum, max_rxdesc_used, max_rxdesc_default,
1350 txnum, max_txdesc_used, max_txdesc_default);
1353 ch->rxd_num = rxnum;
1354 ch->txd_num = txnum;
1355 ch->rxix_irq_srv = 0;
1357 ch->mdr = OS_kmalloc (sizeof (struct mdesc) * rxnum);
1358 ch->mdt = OS_kmalloc (sizeof (struct mdesc) * txnum);
1359 if (ch->p.chan_mode == CFG_CH_PROTO_TRANS)
1360 tmp = __constant_cpu_to_le32 (cxt1e1_max_mru | EOBIRQ_ENABLE);
1362 tmp = __constant_cpu_to_le32 (cxt1e1_max_mru);
1364 for (i = 0, md = ch->mdr; i < rxnum; i++, md++)
1366 if (i == (rxnum - 1))
1368 md->snext = &ch->mdr[0];/* wrapness */
1371 md->snext = &ch->mdr[i + 1];
1373 md->next = cpu_to_le32 (OS_vtophys (md->snext));
1375 if (!(m = OS_mem_token_alloc (cxt1e1_max_mru)))
1377 if (cxt1e1_log_level >= LOG_MONITOR)
1378 pr_info("%s: c4_chan_up[%d] - token alloc failure, size = %d.\n",
1379 ci->devname, channum, cxt1e1_max_mru);
1383 md->data = cpu_to_le32 (OS_vtophys (OS_mem_token_data (m)));
1384 md->status = tmp | MUSYCC_RX_OWNED; /* MUSYCC owns RX descriptor **
1386 * MUSYCC_RX_OWNED = 0 so no
1387 * need to byteSwap */
1390 for (i = 0, md = ch->mdt; i < txnum; i++, md++)
1392 md->status = HOST_TX_OWNED; /* Host owns TX descriptor ** CODING
1393 * NOTE: HOST_TX_OWNED = 0 so no need to
1397 if (i == (txnum - 1))
1399 md->snext = &ch->mdt[0];/* wrapness */
1402 md->snext = &ch->mdt[i + 1];
1404 md->next = cpu_to_le32 (OS_vtophys (md->snext));
1406 ch->txd_irq_srv = ch->txd_usr_add = &ch->mdt[0];
1407 ch->txd_free = txnum;
1409 ch->txd_required = 0;
1411 /* Configure it into the chip */
1412 tmp = cpu_to_le32 (OS_vtophys (&ch->mdt[0]));
1413 pi->regram->thp[gchan] = tmp;
1414 pi->regram->tmp[gchan] = tmp;
1416 tmp = cpu_to_le32 (OS_vtophys (&ch->mdr[0]));
1417 pi->regram->rhp[gchan] = tmp;
1418 pi->regram->rmp[gchan] = tmp;
1420 /* Activate the Channel */
1422 if (ch->p.status & RX_ENABLED)
1424 #ifdef RLD_TRANS_DEBUG
1425 pr_info("++ c4_chan_up() CHAN RX ACTIVATE: chan %d\n", ch->channum);
1427 ch->ch_start_rx = 0; /* we are restarting RX... */
1428 musycc_serv_req (pi, SR_CHANNEL_ACTIVATE | SR_RX_DIRECTION | gchan);
1430 if (ch->p.status & TX_ENABLED)
1432 #ifdef RLD_TRANS_DEBUG
1433 pr_info("++ c4_chan_up() CHAN TX ACTIVATE: chan %d <delayed>\n", ch->channum);
1435 ch->ch_start_tx = CH_START_TX_1ST; /* we are delaying start
1436 * until receipt from user of
1437 * first packet to transmit. */
1439 ch->status = ch->p.status;
1446 /* Don't leak all the previously allocated mbufs in this loop */
1448 OS_mem_token_free (ch->mdr[i].mem_token);
1460 /* stop the hardware from servicing & interrupting */
1463 c4_stopwd (ci_t *ci)
1465 OS_stop_watchdog (&ci->wd);
1466 SD_SEM_TAKE (&ci->sem_wdbusy, "_stop_"); /* ensure WD not running */
1467 SD_SEM_GIVE (&ci->sem_wdbusy);
1472 sbecom_get_brdinfo (ci_t *ci, struct sbe_brd_info *bip, u_int8_t *bsn)
1478 bip->brdno = ci->brdno; /* our board number */
1479 bip->brd_id = ci->brd_id;
1480 bip->brd_hdw_id = ci->hdw_bid;
1481 bip->brd_chan_cnt = MUSYCC_NCHANS *ci->max_port; /* number of channels
1483 bip->brd_port_cnt = ci->max_port; /* number of ports being used */
1484 bip->brd_pci_speed = BINFO_PCI_SPEED_unk; /* PCI speed not yet
1490 struct net_device *dev;
1492 dev = (struct net_device *) ci->first_if;
1493 np = (char *) dev->name;
1495 strncpy (bip->first_iname, np, CHNM_STRLEN - 1);
1497 strcpy (bip->first_iname, "<NULL>");
1501 struct net_device *dev;
1503 dev = (struct net_device *) ci->last_if;
1504 np = (char *) dev->name;
1506 strncpy (bip->last_iname, np, CHNM_STRLEN - 1);
1508 strcpy (bip->last_iname, "<NULL>");
1512 for (i = 0; i < 3; i++)
1514 bip->brd_mac_addr[i] = *bsn++;
1518 bip->brd_mac_addr[i] = *bsn;
1519 sn = (sn << 8) | *bsn++;
1523 for (i = 0; i < 6; i++)
1524 bip->brd_mac_addr[i] = 0;
1531 c4_get_iidinfo (ci_t *ci, struct sbe_iid_info *iip)
1533 struct net_device *dev;
1536 if (!(dev = getuserbychan (iip->channum)))
1540 strncpy (iip->iname, np, CHNM_STRLEN - 1);
1541 iip->iname[CHNM_STRLEN - 1] = '\0';
1546 #ifdef CONFIG_SBE_PMCC4_NCOMM
1547 void (*nciInterrupt[MAX_BOARDS][4]) (void);
1548 extern void wanpmcC4T1E1_hookInterrupt (int cardID, int deviceID, void *handler);
1551 wanpmcC4T1E1_hookInterrupt (int cardID, int deviceID, void *handler)
1553 if (cardID < MAX_BOARDS) /* sanity check */
1554 nciInterrupt[cardID][deviceID] = handler;
1558 c4_ebus_intr_th_handler (void *devp)
1560 ci_t *ci = (ci_t *) devp;
1561 volatile u_int32_t ists;
1565 /* which COMET caused the interrupt */
1567 ists = pci_read_32 ((u_int32_t *) &ci->cpldbase->intr);
1568 if (ists & PMCC4_CPLD_INTR_CMT_1)
1571 if (nciInterrupt[brdno][0] != NULL)
1572 (*nciInterrupt[brdno][0]) ();
1574 if (ists & PMCC4_CPLD_INTR_CMT_2)
1577 if (nciInterrupt[brdno][1] != NULL)
1578 (*nciInterrupt[brdno][1]) ();
1580 if (ists & PMCC4_CPLD_INTR_CMT_3)
1583 if (nciInterrupt[brdno][2] != NULL)
1584 (*nciInterrupt[brdno][2]) ();
1586 if (ists & PMCC4_CPLD_INTR_CMT_4)
1589 if (nciInterrupt[brdno][3] != NULL)
1590 (*nciInterrupt[brdno][3]) ();
1593 /*** Test code just de-implements the asserted interrupt. Alternate
1594 vendor will supply COMET interrupt handling code herein or such.
1596 pci_write_32 ((u_int32_t *) &ci->reg->glcd, GCD_MAGIC | MUSYCC_GCD_INTB_DISABLE);
1599 return IRQ_RETVAL (handled);
1604 wanpmcC4T1E1_getBaseAddress (int cardID, int deviceID)
1607 unsigned long base = 0;
1612 if (ci->brdno == cardID) /* found valid device */
1614 if (deviceID < ci->max_port) /* comet is supported */
1615 base = ((unsigned long) ci->port[deviceID].cometbase);
1618 ci = ci->next; /* next board, if any */
1623 #endif /*** CONFIG_SBE_PMCC4_NCOMM ***/
1626 /*** End-of-File ***/