示例#1
0
//---------------------------------------------------------------------------
// Decode CONN_LOSS_IND message from RRC
void nas_mesh_DC_decode_cx_loss_ind(struct cx_entity *cx, struct nas_ue_dc_element *p)
{
  //---------------------------------------------------------------------------
  // Start debug information
#ifdef NAS_DEBUG_DC
  printk("NAS_MESH_DC_DECODE_CX_LOSS - begin \n");
#endif

  if (cx==NULL) {
#ifdef NAS_DEBUG_DC
    printk("NAS_MESH_DC_DECODE_CX_LOSS - input parameter cx is NULL \n");
#endif
    return;
  }

  if (p==NULL) {
#ifdef NAS_DEBUG_DC
    printk("NAS_MESH_DC_DECODE_CX_LOSS - input parameter p is NULL \n");
#endif
    return;
  }

  // End debug information
  cx->state=NAS_IDLE;
  cx->iid4=0;
  //nas_TOOL_imei2iid(NAS_NULL_IMEI, (uint8_t *)cx->iid6);
  nas_COMMON_flush_rb(cx);
#ifdef NAS_DEBUG_DC
  printk("NAS_MESH_DC_RECEIVE: CONN_LOSS_IND reception\n");
  printk(" Local Connection reference %u\n", p->nasUEDCPrimitive.conn_loss_ind.localConnectionRef);
  print_TOOL_state(cx->state);
#endif
}
示例#2
0
文件: device.c 项目: a4a881d4/oai
//---------------------------------------------------------------------------
void nas_teardown(struct net_device *dev){
  //---------------------------------------------------------------------------
  int cxi;

  struct nas_priv *priv;
  int inst;

  if (dev) {
    priv = netdev_priv(dev);
    inst = find_inst(dev);
    if (inst<0) {
      printk("nas_teardown: ERROR, couldn't find instance\n");
    }
    printk("nas_teardown instance %d: begin\n",inst);
    

    
    nas_CLASS_flush_rclassifier(priv);
    
    for (cxi=0;cxi<NAS_CX_MAX;cxi++) {
      nas_COMMON_flush_rb(priv->cx+cxi);
      nas_CLASS_flush_sclassifier(priv->cx+cxi);
    }
    
    printk("nas_teardown: end\n");
  } // check dev
  else {
    printk("nas_teardown: Device is null\n");
  }
}
示例#3
0
//---------------------------------------------------------------------------
// Request the release of a connexion (DC channel)
int nas_mesh_DC_send_cx_release_request(struct cx_entity *cx,
                                        struct nas_priv *gpriv)
{
  //---------------------------------------------------------------------------
  struct nas_ue_dc_element *p;
  int bytes_wrote=0;

  // Start debug information
#ifdef NAS_DEBUG_DC
  printk("NAS_MESH_DC_SEND_CX_RELEASE - begin \n");
#endif

  if (cx==NULL) {
#ifdef NAS_DEBUG_DC
    printk("NAS_MESH_DC_SEND_CX_RELEASE - input parameter cx is NULL \n");
#endif
    return NAS_ERROR_NOTCORRECTVALUE;
  }

  // End debug information
  switch (cx->state) {
  case NAS_CX_RELEASING_FAILURE:
  case NAS_CX_DCH:
    p= (struct nas_ue_dc_element *)(gpriv->xbuffer);
    p->type = CONN_RELEASE_REQ;
    p->length =  NAS_TL_SIZE + sizeof(struct NASConnReleaseReq);
    p->nasUEDCPrimitive.conn_release_req.localConnectionRef = cx->lcr;
    p->nasUEDCPrimitive.conn_release_req.releaseCause = NAS_CX_RELEASE_UNDEF_CAUSE;
#ifdef PDCP_USE_NETLINK

#else
    //      bytes_wrote = rtf_put(cx->sap[NAS_DC_INPUT_SAPI], p, p->length);
#endif

    if (bytes_wrote==p->length) {
      cx->state=NAS_IDLE;
      cx->iid4=0;
      //      nas_TOOL_imei2iid(NAS_NULL_IMEI, (uint8_t *)cx->iid6);
      nas_COMMON_flush_rb(cx);

#ifdef NAS_DEBUG_DC
      printk("NAS_MESH_DC_SEND_CX_RELEASE_REQUEST: Message sent successfully in DC-FIFO\n");
      printk(" Local Connection Reference %u\n", p->nasUEDCPrimitive.conn_release_req.localConnectionRef);
      printk(" Release Cause %u\n", p->nasUEDCPrimitive.conn_release_req.releaseCause);
      print_TOOL_state(cx->state);
#endif
    } else {
      ++cx->retry;
      cx->countimer=gpriv->timer_release;
      cx->state=NAS_CX_RELEASING_FAILURE;
      printk("NAS_MESH_DC_SEND_CX_RELEASE_REQUEST: Message sent failure in DC-FIFO\n");
      print_TOOL_state(cx->state);
    }

    return bytes_wrote;

  default:
    return -NAS_ERROR_NOTCONNECTED;
#ifdef NAS_DEBUG_DC
    printk("NAS_MESH_DC_SEND_CX_RELEASE_REQUEST - NAS_ERROR_NOTCONNECTED \n");
#endif
  }
}