2 * C Implementation: slavetest
7 * Author: root <root@ubuntu>, (C) 2008
9 * Copyright: See COPYING file that comes with this distribution
20 #include <sys/ioctl.h>
21 #include "hcidriver.h"
23 cmd_state_request array_req[MAX_CMD_STATE_REQUEST];
27 int req_fcn_add(cmd_state_request *p_req){ //fcn add the request at the end of array or replace the oldest request
29 cmd_state_request the_oldest=array_req[0];
31 for(i=0;i<MAX_CMD_STATE_REQUEST;i++){
32 if((array_req[i].actual_status)==0 || array_req[i].actual_status==3 ){
38 if((array_req[i].id) < the_oldest.id){ //the smallest id (oldest request) will stay here
39 the_oldest = array_req[i];
46 array_req[index]=*p_req;
52 void rutine_con_req(void *arg){
62 cmd_state_request new_req,*p_new_req=&new_req;
63 memset(array_req,0,(sizeof(cmd_state_request)*MAX_CMD_STATE_REQUEST));
67 p_new_req->id=cmd_req_id++;
68 //p_new_req->req_opcode = ocf_ogf;
69 p_new_req->evt_code = EVT_CONN_REQUEST;
70 p_new_req->p_serv_rutine=&rutine_con_req;