Lines Matching refs:p_pcb
52 tBTA_JV_PCB *p_pcb = &bta_jv_cb.port_cb[p_cb->rfc_hdl[__si] - 1]
189 tBTA_JV_PCB *p_pcb;
207 p_pcb = &bta_jv_cb.port_cb[port_handle - 1];
208 p_pcb->handle = p_cb->handle;
209 p_pcb->port_handle = port_handle;
210 p_pcb->p_pm_cb = NULL;
211 *pp_pcb = p_pcb;
234 tBTA_JV_PCB *p_pcb = NULL;
239 p_pcb = &bta_jv_cb.port_cb[port_handle - 1];
242 return p_pcb;
276 static tBTA_JV_STATUS bta_jv_free_rfc_cb(tBTA_JV_RFC_CB *p_cb, tBTA_JV_PCB *p_pcb)
282 if (!p_cb || !p_pcb)
284 APPL_TRACE_ERROR0("bta_jv_free_sr_rfc_cb, p_cb or p_pcb cannot be null");
287 APPL_TRACE_DEBUG6("bta_jv_free_sr_rfc_cb: max_sess:%d, curr_sess:%d, p_pcb:%p, user:"
288 "%d, state:%d, jv handle: 0x%x" ,p_cb->max_sess, p_cb->curr_sess, p_pcb,
289 (int)p_pcb->user_data, p_pcb->state, p_pcb->handle);
294 switch (p_pcb->state)
299 "scn:%d, p_pcb:%p, user_data:%d", p_pcb->state, p_cb->scn, p_pcb,
300 (int)p_pcb->user_data);
304 p_pcb->state = BTA_JV_ST_CL_CLOSING;
306 " user_data:%d", p_cb->scn, (int)p_pcb->user_data);
309 p_pcb->state = BTA_JV_ST_SR_CLOSING;
312 " user_data:%d", p_cb->scn, (int)p_pcb->user_data);
315 p_pcb->state = BTA_JV_ST_SR_CLOSING;
317 " user_data:%d", p_cb->scn, (int)p_pcb->user_data);
321 "%d, p_pcb:%p, jv handle: 0x%x, port_handle: %d, user_data:%d",
322 p_pcb->state, p_cb->scn, p_pcb, p_pcb->handle, p_pcb->port_handle,
323 (int)p_pcb->user_data);
332 port_status = RFCOMM_RemoveConnection(p_pcb->port_handle);
334 port_status = RFCOMM_RemoveServer(p_pcb->port_handle);
340 p_pcb->handle, p_pcb->state, port_status, p_pcb->port_handle,
346 p_pcb->port_handle = 0;
347 p_pcb->state = BTA_JV_ST_NONE;
348 bta_jv_free_set_pm_profile_cb(p_pcb->handle);
351 p_pcb->cong = FALSE;
352 p_pcb->user_data = 0;
353 int si = BTA_JV_RFC_HDL_TO_SIDX(p_pcb->handle);
356 p_pcb->handle = 0;
470 tBTA_JV_PCB *p_pcb = bta_jv_rfc_port_to_pcb(bta_jv_cb.rfc_cb[hi].rfc_hdl[si]);
471 if (p_pcb)
473 if (NULL == p_pcb->p_pm_cb)
476 "pm_cb?", jv_handle, p_pcb->port_handle, i);
477 p_cb = &p_pcb->p_pm_cb;
1940 tBTA_JV_PCB *p_pcb = bta_jv_rfc_port_to_pcb(port_handle);
1941 APPL_TRACE_DEBUG3("bta_jv_port_data_co_cback, p_cb:%p, p_pcb:%p, len:%d",
1942 p_cb, p_pcb, len);
1943 if (p_pcb != NULL)
1948 return bta_co_rfc_data_incoming(p_pcb->user_data, (BT_HDR*)buf);
1950 return bta_co_rfc_data_outgoing_size(p_pcb->user_data, (int*)buf);
1952 return bta_co_rfc_data_outgoing(p_pcb->user_data, buf, len);
1974 tBTA_JV_PCB *p_pcb = bta_jv_rfc_port_to_pcb(port_handle);
1994 p_pcb->state = BTA_JV_ST_CL_OPEN;
1995 p_cb->p_cback(BTA_JV_RFCOMM_OPEN_EVT, &evt_data, p_pcb->user_data);
2003 if (p_pcb->state == BTA_JV_ST_CL_CLOSING)
2007 //p_pcb->state = BTA_JV_ST_NONE;
2008 //p_pcb->cong = FALSE;
2010 p_cback(BTA_JV_RFCOMM_CLOSE_EVT, &evt_data, p_pcb->user_data);
2011 //bta_jv_free_rfc_cb(p_cb, p_pcb);
2028 tBTA_JV_PCB *p_pcb = bta_jv_rfc_port_to_pcb(port_handle);
2040 p_cb->p_cback(BTA_JV_RFCOMM_DATA_IND_EVT, &evt_data, p_pcb->user_data);
2045 p_pcb->cong = (code & PORT_EV_FCS) ? FALSE : TRUE;
2046 evt_data.rfc_cong.cong = p_pcb->cong;
2049 p_cb->p_cback(BTA_JV_RFCOMM_CONG_EVT, &evt_data, p_pcb->user_data);
2054 bta_jv_pm_conn_idle(p_pcb->p_pm_cb);
2074 tBTA_JV_PCB *p_pcb;
2102 p_cb = bta_jv_alloc_rfc_cb(handle, &p_pcb);
2108 p_pcb->state = BTA_JV_ST_CL_OPENING;
2109 p_pcb->user_data = cc->user_data;
2178 tBTA_JV_PCB *p_pcb = NULL;
2187 if (!find_rfc_pcb(user_data, &p_cb, &p_pcb))
2189 bta_jv_free_rfc_cb(p_cb, p_pcb);
2207 tBTA_JV_PCB *p_pcb;
2216 p_pcb = &bta_jv_cb.port_cb[p_cb->rfc_hdl[i] - 1];
2217 if (BTA_JV_ST_SR_LISTEN == p_pcb->state)
2239 tBTA_JV_PCB *p_pcb = bta_jv_rfc_port_to_pcb(port_handle);
2253 void *user_data = p_pcb->user_data;
2254 APPL_TRACE_DEBUG5( "bta_jv_port_mgmt_sr_cback code=%d port_handle:0x%x handle:0x%x, p_pcb:%p, user:%d",
2255 code, port_handle, p_cb->handle, p_pcb, p_pcb->user_data);
2261 evt_data.rfc_srv_open.handle = p_pcb->handle;
2264 tBTA_JV_PCB *p_pcb_new_listen = bta_jv_add_rfc_port(p_cb, p_pcb);
2281 p_pcb->cong = FALSE;
2286 if(BTA_JV_ST_SR_CLOSING == p_pcb->state)
2291 //p_pcb->state = BTA_JV_ST_NONE;
2293 //bta_jv_free_rfc_cb(p_cb, p_pcb);
2311 tBTA_JV_PCB *p_pcb = bta_jv_rfc_port_to_pcb(port_handle);
2321 void *user_data = p_pcb->user_data;
2330 p_pcb->cong = (code & PORT_EV_FCS) ? FALSE : TRUE;
2331 evt_data.rfc_cong.cong = p_pcb->cong;
2339 bta_jv_pm_conn_idle(p_pcb->p_pm_cb);
2358 tBTA_JV_PCB *p_pcb = NULL;
2365 p_pcb = &bta_jv_cb.port_cb[p_cb->rfc_hdl[i] - 1];
2366 if (p_pcb->state == BTA_JV_ST_SR_LISTEN)
2369 if(p_pcb_open == p_pcb)
2372 p_pcb->port_handle);
2373 p_pcb->state = BTA_JV_ST_SR_OPEN;
2380 listen, p_pcb->port_handle, p_pcb_open->handle);
2401 p_pcb = &bta_jv_cb.port_cb[p_cb->rfc_hdl[si] - 1];
2402 p_pcb->state = BTA_JV_ST_SR_LISTEN;
2403 p_pcb->port_handle = p_cb->rfc_hdl[si];
2404 p_pcb->user_data = p_pcb_open->user_data;
2406 PORT_ClearKeepHandleFlag(p_pcb->port_handle);
2407 PORT_SetEventCallback(p_pcb->port_handle, bta_jv_port_event_sr_cback);
2408 PORT_SetDataCOCallback (p_pcb->port_handle, bta_jv_port_data_co_cback);
2409 PORT_SetEventMask(p_pcb->port_handle, event_mask);
2410 PORT_GetState(p_pcb->port_handle, &port_state);
2416 PORT_SetState(p_pcb->port_handle, &port_state);
2417 p_pcb->handle = BTA_JV_RFC_H_S_TO_HDL(p_cb->handle, si);
2418 APPL_TRACE_DEBUG2("bta_jv_add_rfc_port: p_pcb->handle:0x%x, curr_sess:%d",
2419 p_pcb->handle, p_cb->curr_sess);
2427 return p_pcb;
2447 tBTA_JV_PCB *p_pcb;
2477 p_cb = bta_jv_alloc_rfc_cb(handle, &p_pcb);
2488 p_pcb->state = BTA_JV_ST_SR_LISTEN;
2489 p_pcb->user_data = rs->user_data;
2534 tBTA_JV_PCB *p_pcb = NULL;
2542 if(!find_rfc_pcb(user_data, &p_cb, &p_pcb))
2544 APPL_TRACE_DEBUG2("bta_jv_rfcomm_stop_server: p_pcb:%p, p_pcb->port_handle:%d",
2545 p_pcb, p_pcb->port_handle);
2546 bta_jv_free_rfc_cb(p_cb, p_pcb);
2564 tBTA_JV_PCB *p_pcb = rc->p_pcb;
2571 if (PORT_ReadData(rc->p_pcb->port_handle, (char *)rc->p_data, rc->len, &evt_data.len) ==
2577 p_cb->p_cback(BTA_JV_RFCOMM_READ_EVT, (tBTA_JV *)&evt_data, p_pcb->user_data);
2593 tBTA_JV_PCB *p_pcb = wc->p_pcb;
2599 evt_data.cong = p_pcb->cong;
2601 bta_jv_pm_conn_busy(p_pcb->p_pm_cb);
2603 PORT_WriteDataCO(p_pcb->port_handle, &evt_data.len) ==
2609 evt_data.cong = p_pcb->cong;
2612 p_cb->p_cback(BTA_JV_RFCOMM_WRITE_EVT, (tBTA_JV *)&evt_data, p_pcb->user_data);