📄 x400p-ss7.c
字号:
return (QR_STRIP);}/* * CH_INFO_REQ * ----------------------------------- */STATIC intch_info_req(queue_t *q, mblk_t *mp){ fixme(("Write this function\n")); return (-EFAULT);}/* * CH_OPTMGMT_REQ * ----------------------------------- */STATIC intch_optmgmt_req(queue_t *q, mblk_t *mp){ fixme(("Write this function\n")); return (-EFAULT);}/* * CH_ATTACH_REQ * ----------------------------------- */STATIC intch_attach_req(queue_t *q, mblk_t *mp){ fixme(("Write this function\n")); return (-EFAULT);}/* * CH_ENABLE_REQ * ----------------------------------- */STATIC intch_enable_req(queue_t *q, mblk_t *mp){ fixme(("Write this function\n")); return (-EFAULT);}/* * CH_CONNECT_REQ * ----------------------------------- */STATIC intch_connect_req(queue_t *q, mblk_t *mp){ fixme(("Write this function\n")); return (-EFAULT);}/* * CH_DISCONNECT_REQ * ----------------------------------- */STATIC intch_disconnect_req(queue_t *q, mblk_t *mp){ fixme(("Write this function\n")); return (-EFAULT);}/* * CH_DISABLE_REQ * ----------------------------------- */STATIC intch_disable_req(queue_t *q, mblk_t *mp){ fixme(("Write this function\n")); return (-EFAULT);}/* * CH_DETACH_REQ * ----------------------------------- */STATIC intch_detach_req(queue_t *q, mblk_t *mp){ fixme(("Write this function\n")); return (-EFAULT);}/* * M_DATA * ----------------------------------- */STATIC intmx_m_data(queue_t *q, mblk_t *mp){ return ch_m_data(q, mp);}/* * MX_DATA_REQ * ----------------------------------- */STATIC intmx_data_req(queue_t *q, mblk_t *mp){ fixme(("Write this function\n")); return (-EFAULT);}/* * MX_INFO_REQ * ----------------------------------- */STATIC intmx_info_req(queue_t *q, mblk_t *mp){ fixme(("Write this function\n")); return (-EFAULT);}/* * MX_OPTMGMT_REQ * ----------------------------------- */STATIC intmx_optmgmt_req(queue_t *q, mblk_t *mp){ fixme(("Write this function\n")); return (-EFAULT);}/* * MX_ATTACH_REQ * ----------------------------------- */STATIC intmx_attach_req(queue_t *q, mblk_t *mp){ fixme(("Write this function\n")); return (-EFAULT);}/* * MX_ENABLE_REQ * ----------------------------------- */STATIC intmx_enable_req(queue_t *q, mblk_t *mp){ fixme(("Write this function\n")); return (-EFAULT);}/* * MX_CONNECT_REQ * ----------------------------------- */STATIC intmx_connect_req(queue_t *q, mblk_t *mp){ fixme(("Write this function\n")); return (-EFAULT);}/* * MX_DISCONNECT_REQ * ----------------------------------- */STATIC intmx_disconnect_req(queue_t *q, mblk_t *mp){ fixme(("Write this function\n")); return (-EFAULT);}/* * MX_DISABLE_REQ * ----------------------------------- */STATIC intmx_disable_req(queue_t *q, mblk_t *mp){ fixme(("Write this function\n")); return (-EFAULT);}/* * MX_DETACH_REQ * ----------------------------------- */STATIC intmx_detach_req(queue_t *q, mblk_t *mp){ fixme(("Write this function\n")); return (-EFAULT);}/* * M_DATA * ----------------------------------- */STATIC intlm_m_data(queue_t *q, mblk_t *mp){ fixme(("Write this function\n")); return (-EFAULT);}/* * ========================================================================= * * IO Controls * * ========================================================================= *//* * ------------------------------------------------------------------------- * * Test SDL configuration settings * * ------------------------------------------------------------------------- */STATIC intsdl_test_config(struct xp *xp, sdl_config_t * arg){ int ret = 0; psw_t flags = 0; if (!xp) return (-EFAULT); spin_lock_irqsave(&xp->lock, flags); do { if (arg->ifflags) { ret = -EINVAL; break; } switch (arg->iftype) { case SDL_TYPE_NONE: /* unknown/unspecified */ arg->iftype = xp->obj.sdl.config.iftype; break; case SDL_TYPE_DS0: /* DS0 channel */ case SDL_TYPE_DS0A: /* DS0A channel */ /* yes we allow DS0A on E1 */ break; case SDL_TYPE_E1: /* full E1 span */ if (xp->sp->config.ifgtype != SDL_GTYPE_E1) { ret = (-EINVAL); break; } break; case SDL_TYPE_T1: /* full T1 span */ if (xp->sp->config.ifgtype != SDL_GTYPE_T1) { ret = (-EINVAL); break; } break; default: ret = (-EINVAL); break; } if (ret) break; switch (arg->ifmode) { case SDL_MODE_NONE: /* */ arg->ifmode = xp->obj.sdl.config.ifmode; break; case SDL_MODE_PEER: /* */ break; case SDL_MODE_ECHO: /* */ case SDL_MODE_REM_LB: /* */ case SDL_MODE_LOC_LB: /* */ case SDL_MODE_LB_ECHO: /* */ case SDL_MODE_TEST: /* */ break; default: ret = (-EINVAL); break; } switch (arg->ifgmode) { case SDL_GMODE_NONE: case SDL_GMODE_LOC_LB: break; case SDL_GMODE_REM_LB: default: ret = (-EINVAL); break; } if (ret) break; if (xp->sp) { switch (arg->ifgtype) { case SDL_GTYPE_NONE: /* */ arg->ifgtype = xp->sp->config.ifgtype; break; case SDL_GTYPE_T1: /* */ case SDL_GTYPE_E1: /* */ if (arg->ifgtype != xp->sp->config.ifgtype) { ret = (-EINVAL); break; } break; default: ret = (-EINVAL); break; } if (ret) break; switch (arg->ifgcrc) { case SDL_GCRC_NONE: /* */ switch (arg->ifgtype) { case SDL_GTYPE_E1: arg->ifgcrc = SDL_GCRC_CRC5; break; case SDL_GTYPE_T1: arg->ifgcrc = SDL_GCRC_CRC6; break; default: ret = (-EINVAL); break; } break; case SDL_GCRC_CRC4: /* */ if (arg->ifgtype != SDL_GTYPE_E1) { ret = (-EINVAL); break; } break; case SDL_GCRC_CRC5: /* */ if (arg->ifgtype != SDL_GTYPE_E1) { ret = (-EINVAL); break; } break; case SDL_GCRC_CRC6: /* */ if (arg->ifgtype != SDL_GTYPE_T1) { ret = (-EINVAL); break; } break; default: ret = (-EINVAL); break; } if (ret) break; switch (arg->ifclock) { case SDL_CLOCK_NONE: /* */ arg->ifclock = xp->sp->config.ifclock; break; case SDL_CLOCK_INT: /* */ case SDL_CLOCK_MASTER: /* */ arg->ifclock = SDL_CLOCK_MASTER; break; case SDL_CLOCK_EXT: /* */ case SDL_CLOCK_SLAVE: /* */ arg->ifclock = SDL_CLOCK_SLAVE; break; case SDL_CLOCK_LOOP: /* */ break; default: ret = (-EINVAL); break; } if (ret) break; switch (arg->ifcoding) { case SDL_CODING_NONE: /* */ arg->ifcoding = xp->sp->config.ifcoding; break; case SDL_CODING_AMI: /* */ break; case SDL_CODING_B8ZS: /* */ if (arg->ifgtype != SDL_GTYPE_T1) { ret = (-EINVAL); break; } break; case SDL_CODING_HDB3: /* */ if (arg->ifgtype != SDL_GTYPE_E1) { ret = (-EINVAL); break; } break; default: case SDL_CODING_B6ZS: /* */ ret = (-EINVAL); break; } if (ret) break; switch (arg->ifframing) { case SDL_FRAMING_NONE: /* */ arg->ifframing = xp->sp->config.ifframing; break; case SDL_FRAMING_CCS: /* */ case SDL_FRAMING_CAS: /* */ if (arg->ifgtype != SDL_GTYPE_E1) { ret = (-EINVAL); break; } break; case SDL_FRAMING_SF: /* */ case SDL_FRAMING_ESF: /* */ if (arg->ifgtype != SDL_GTYPE_T1) { ret = (-EINVAL); break; } break; default: ret = (-EINVAL); break; } if (ret) break; switch (arg->iftxlevel) { case 0: arg->iftxlevel = xp->sp->config.iftxlevel; break; case 1: case 2: case 3: case 4: case 5: break; default: ret = (-EINVAL); break; } if (ret) break; if (xp->sp->cd) { int src; for (src = 0; src < SDL_SYNCS; src++) if (arg->ifsyncsrc[src] < 0 || arg->ifsyncsrc[src] > 4) { ret = (-EINVAL); break; } if (ret) break; } else { ret = (-EFAULT); break; } } else { ret = (-EFAULT); break; } } while (0); spin_unlock_irqrestore(&xp->lock, flags); return (ret);}/* * ------------------------------------------------------------------------- * * Commit SDL configuration settings * * ------------------------------------------------------------------------- */STATIC voidsdl_commit_config(struct xp *xp, sdl_config_t * arg){ int chan_reconfig = 0, span_reconfig = 0, card_reconfig = 0; struct sp *sp = NULL; struct cd *cd = NULL; psw_t flags = 0; if (!xp) return; spin_lock_irqsave(&xp->lock, flags); { if (xp->obj.sdl.config.iftype != arg->iftype) { xp->obj.sdl.config.iftype = arg->iftype; chan_reconfig = 1; } switch (arg->iftype) { case SDL_TYPE_DS0A: xp->obj.sdl.config.ifrate = 56000; break; case SDL_TYPE_DS0: xp->obj.sdl.config.ifrate = 64000; break; case SDL_TYPE_T1: xp->obj.sdl.config.ifrate = 1544000; break; case SDL_TYPE_E1: xp->obj.sdl.config.ifrate = 2048000; break; } if (xp->obj.sdl.config.ifrate != arg->ifrate) { xp->obj.sdl.config.ifrate = arg->ifrate; chan_reconfig = 1; } if (xp->obj.sdl.config.ifmode != arg->ifmode) { xp->obj.sdl.config.ifmode = arg->ifmode; chan_reconfig = 1; } if ((sp = xp->sp)) { int slot; if (sp->config.ifgcrc != arg->ifgcrc) { for (slot = 0; slot < 32; slot++) if (sp->slots[slot] && sp->slots[slot]->xp) sp->slots[slot]->xp->obj.sdl.config.ifgcrc = arg->ifgcrc; sp->config.ifgcrc = arg->ifgcrc; span_reconfig = 1; } if (sp->config.ifgmode != arg->ifgmode) { for (slot = 0; slot < 32; slot++) if (sp->slots[slot] && sp->slots[slot]->xp) sp->slots[slot]->xp->obj.sdl.config.ifgmode = arg->ifgmode; sp->config.ifgmode = arg->ifgmode; span_reconfig = 1; } if (sp->config.ifclock != arg->ifclock) { for (slot = 0; slot < 32; slot++) if (sp->slots[slot] && sp->slots[slot]->xp) sp->slots[slot]->xp->obj.sdl.config.ifclock = arg->ifclock; sp->config.ifclock = arg->ifclock; span_reconfig = 1; } if (sp->config.ifcoding != arg->ifcoding) { for (slot = 0; slot < 32; slot++) if (sp->slots[slot] && sp->slots[slot]->xp) sp->slots[slot]->xp->obj.sdl.config.ifcoding = arg->ifcoding; sp->config.ifcoding = arg->ifcoding; span_reconfig = 1; } if (sp->config.ifframing != arg->ifframing) { for (slot = 0; slot < 32; slot++) if (sp->slots[slot] && sp->slots[slot]->xp)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -