Lines Matching refs:p_cb
54 tGKI_COM_CB *p_cb = &gki_cb.com;
63 p_cb->pool_start[id] = (UINT8 *)p_mem;
64 p_cb->pool_end[id] = (UINT8 *)p_mem + (act_size * total);
67 p_cb->pool_size[id] = act_size;
69 p_cb->freeq[id].size = (UINT16) tempsize;
70 p_cb->freeq[id].total = total;
71 p_cb->freeq[id].cur_cnt = 0;
72 p_cb->freeq[id].max_cnt = 0;
82 p_cb->freeq[id].p_first = hdr;
95 p_cb->freeq[id].p_last = hdr1;
104 tGKI_COM_CB *p_cb = &gki_cb.com;
109 Q = &p_cb->freeq[p_cb->pool_list[id]];
148 tGKI_COM_CB *p_cb = &gki_cb.com;
155 p_cb->OSTaskQFirst[tt][mb] = NULL;
156 p_cb->OSTaskQLast [tt][mb] = NULL;
162 p_cb->pool_start[tt] = NULL;
163 p_cb->pool_end[tt] = NULL;
164 p_cb->pool_size[tt] = 0;
166 p_cb->freeq[tt].p_first = 0;
167 p_cb->freeq[tt].p_last = 0;
168 p_cb->freeq[tt].size = 0;
169 p_cb->freeq[tt].total = 0;
170 p_cb->freeq[tt].cur_cnt = 0;
171 p_cb->freeq[tt].max_cnt = 0;
175 p_cb->pool_access_mask = GKI_DEF_BUFPOOL_PERM_MASK;
180 p_cb->bufpool0 = (UINT8 *)GKI_os_malloc ((GKI_BUF0_SIZE + BUFFER_PADDING_SIZE) * GKI_BUF0_MAX);
184 p_cb->bufpool1 = (UINT8 *)GKI_os_malloc ((GKI_BUF1_SIZE + BUFFER_PADDING_SIZE) * GKI_BUF1_MAX);
188 p_cb->bufpool2 = (UINT8 *)GKI_os_malloc ((GKI_BUF2_SIZE + BUFFER_PADDING_SIZE) * GKI_BUF2_MAX);
192 p_cb->bufpool3 = (UINT8 *)GKI_os_malloc ((GKI_BUF3_SIZE + BUFFER_PADDING_SIZE) * GKI_BUF3_MAX);
196 p_cb->bufpool4 = (UINT8 *)GKI_os_malloc ((GKI_BUF4_SIZE + BUFFER_PADDING_SIZE) * GKI_BUF4_MAX);
200 p_cb->bufpool5 = (UINT8 *)GKI_os_malloc ((GKI_BUF5_SIZE + BUFFER_PADDING_SIZE) * GKI_BUF5_MAX);
204 p_cb->bufpool6 = (UINT8 *)GKI_os_malloc ((GKI_BUF6_SIZE + BUFFER_PADDING_SIZE) * GKI_BUF6_MAX);
208 p_cb->bufpool7 = (UINT8 *)GKI_os_malloc ((GKI_BUF7_SIZE + BUFFER_PADDING_SIZE) * GKI_BUF7_MAX);
212 p_cb->bufpool8 = (UINT8 *)GKI_os_malloc ((GKI_BUF8_SIZE + BUFFER_PADDING_SIZE) * GKI_BUF8_MAX);
216 p_cb->bufpool9 = (UINT8 *)GKI_os_malloc ((GKI_BUF9_SIZE + BUFFER_PADDING_SIZE) * GKI_BUF9_MAX);
220 p_cb->bufpool10 = (UINT8 *)GKI_os_malloc ((GKI_BUF10_SIZE + BUFFER_PADDING_SIZE) * GKI_BUF10_MAX);
224 p_cb->bufpool11 = (UINT8 *)GKI_os_malloc ((GKI_BUF11_SIZE + BUFFER_PADDING_SIZE) * GKI_BUF11_MAX);
228 p_cb->bufpool12 = (UINT8 *)GKI_os_malloc ((GKI_BUF12_SIZE + BUFFER_PADDING_SIZE) * GKI_BUF12_MAX);
232 p_cb->bufpool13 = (UINT8 *)GKI_os_malloc ((GKI_BUF13_SIZE + BUFFER_PADDING_SIZE) * GKI_BUF13_MAX);
236 p_cb->bufpool14 = (UINT8 *)GKI_os_malloc ((GKI_BUF14_SIZE + BUFFER_PADDING_SIZE) * GKI_BUF14_MAX);
240 p_cb->bufpool15 = (UINT8 *)GKI_os_malloc ((GKI_BUF15_SIZE + BUFFER_PADDING_SIZE) * GKI_BUF15_MAX);
247 gki_init_free_queue(0, GKI_BUF0_SIZE, GKI_BUF0_MAX, p_cb->bufpool0);
251 gki_init_free_queue(1, GKI_BUF1_SIZE, GKI_BUF1_MAX, p_cb->bufpool1);
255 gki_init_free_queue(2, GKI_BUF2_SIZE, GKI_BUF2_MAX, p_cb->bufpool2);
259 gki_init_free_queue(3, GKI_BUF3_SIZE, GKI_BUF3_MAX, p_cb->bufpool3);
263 gki_init_free_queue(4, GKI_BUF4_SIZE, GKI_BUF4_MAX, p_cb->bufpool4);
267 gki_init_free_queue(5, GKI_BUF5_SIZE, GKI_BUF5_MAX, p_cb->bufpool5);
271 gki_init_free_queue(6, GKI_BUF6_SIZE, GKI_BUF6_MAX, p_cb->bufpool6);
275 gki_init_free_queue(7, GKI_BUF7_SIZE, GKI_BUF7_MAX, p_cb->bufpool7);
279 gki_init_free_queue(8, GKI_BUF8_SIZE, GKI_BUF8_MAX, p_cb->bufpool8);
283 gki_init_free_queue(9, GKI_BUF9_SIZE, GKI_BUF9_MAX, p_cb->bufpool9);
287 gki_init_free_queue(10, GKI_BUF10_SIZE, GKI_BUF10_MAX, p_cb->bufpool10);
291 gki_init_free_queue(11, GKI_BUF11_SIZE, GKI_BUF11_MAX, p_cb->bufpool11);
295 gki_init_free_queue(12, GKI_BUF12_SIZE, GKI_BUF12_MAX, p_cb->bufpool12);
299 gki_init_free_queue(13, GKI_BUF13_SIZE, GKI_BUF13_MAX, p_cb->bufpool13);
303 gki_init_free_queue(14, GKI_BUF14_SIZE, GKI_BUF14_MAX, p_cb->bufpool14);
307 gki_init_free_queue(15, GKI_BUF15_SIZE, GKI_BUF15_MAX, p_cb->bufpool15);
313 p_cb->pool_list[i] = i;
316 p_cb->curr_total_no_of_pools = GKI_NUM_FIXED_BUF_POOLS;
365 tGKI_COM_CB *p_cb = &gki_cb.com;
380 for (i=0; i < p_cb->curr_total_no_of_pools; i++)
382 if ( size <= p_cb->freeq[p_cb->pool_list[i]].size )
386 if(i == p_cb->curr_total_no_of_pools)
397 for ( ; i < p_cb->curr_total_no_of_pools; i++)
400 if (((UINT16)1 << p_cb->pool_list[i]) & p_cb->pool_access_mask)
403 Q = &p_cb->freeq[p_cb->pool_list[i]];
440 LOGD("GKI_getbuf() allocated, %x, %x (%d of %d used) %d", (UINT8*)p_hdr + BUFFER_HDR_SIZE, p_hdr, Q->cur_cnt, Q->total, p_cb->freeq[i].total);
455 p_cb = &gki_cb.com;
457 LOGD("Dumping total of %d buffer pools", p_cb->curr_total_no_of_pools);
459 for (i=0 ; i < p_cb->curr_total_no_of_pools; i++)
461 p_hdr = (BUFFER_HDR_T *)p_cb->pool_start[i];
463 LOGD("pool %d has a total of %d buffers (start=%p)", i, p_cb->freeq[i].total, p_hdr);
465 for (x=0; p_hdr && x < p_cb->freeq[i].total; x++)
472 p_hdr = (BUFFER_HDR_T *)((UINT8 *)p_hdr + p_cb->pool_size[i]);
509 tGKI_COM_CB *p_cb = &gki_cb.com;
520 Q = &p_cb->freeq[pool_id];
554 LOGD("GKI_getpoolbuf() allocated, %x, %x (%d of %d used) %d", (UINT8*)p_hdr + BUFFER_HDR_SIZE, p_hdr, Q->cur_cnt, Q->total, p_cb->freeq[pool_id].total);
568 return (GKI_getbuf_debug(p_cb->freeq[pool_id].size, _function_, _line_));
571 return (GKI_getbuf(p_cb->freeq[pool_id].size));
712 tGKI_COM_CB *p_cb = &gki_cb.com;
715 if ((task_id >= GKI_MAX_TASKS) || (mbox >= NUM_TASK_MBOX) || (p_cb->OSRdyTbl[task_id] == TASK_DEAD))
740 if (p_cb->OSTaskQFirst[task_id][mbox])
741 p_cb->OSTaskQLast[task_id][mbox]->p_next = p_hdr;
743 p_cb->OSTaskQFirst[task_id][mbox] = p_hdr;
745 p_cb->OSTaskQLast[task_id][mbox] = p_hdr;
1103 tGKI_COM_CB *p_cb = &gki_cb.com;
1108 if ((p_ua > p_cb->pool_start[xx]) && (p_ua < p_cb->pool_end[xx]))
1110 yy = (UINT32)(p_ua - p_cb->pool_start[xx]);
1112 size = p_cb->pool_size[xx];
1116 return ((void *) (p_cb->pool_start[xx] + yy + sizeof(BUFFER_HDR_T)) );
1148 tGKI_COM_CB *p_cb = &gki_cb.com;
1153 p_cb->pool_access_mask = (UINT16)(p_cb->pool_access_mask | (1 << pool_id));
1156 p_cb->pool_access_mask = (UINT16)(p_cb->pool_access_mask & ~(1 << pool_id));
1178 tGKI_COM_CB *p_cb = &gki_cb.com;
1181 for(i=0; i < p_cb->curr_total_no_of_pools; i++)
1184 if(p_cb->freeq[pool_id].size <= p_cb->freeq[ p_cb->pool_list[i] ].size)
1189 for(j = p_cb->curr_total_no_of_pools; j > i; j--)
1191 p_cb->pool_list[j] = p_cb->pool_list[j-1];
1194 p_cb->pool_list[i] = pool_id;
1210 tGKI_COM_CB *p_cb = &gki_cb.com;
1213 for(i=0; i < p_cb->curr_total_no_of_pools; i++)
1215 if(pool_id == p_cb->pool_list[i])
1219 while (i < (p_cb->curr_total_no_of_pools - 1))
1221 p_cb->pool_list[i] = p_cb->pool_list[i+1];
1351 tGKI_COM_CB *p_cb = &gki_cb.com;
1354 if ((task_id >= GKI_MAX_TASKS) || (mbox >= NUM_TASK_MBOX) || (p_cb->OSRdyTbl[task_id] == TASK_DEAD))
1385 if (p_cb->OSTaskQFirst[task_id][mbox])
1386 p_cb->OSTaskQLast[task_id][mbox]->p_next = p_hdr;
1388 p_cb->OSTaskQFirst[task_id][mbox] = p_hdr;
1390 p_cb->OSTaskQLast[task_id][mbox] = p_hdr;
1424 tGKI_COM_CB *p_cb = &gki_cb.com;
1433 if (!p_cb->pool_start[xx])
1454 p_cb->curr_total_no_of_pools++;
1478 tGKI_COM_CB *p_cb = &gki_cb.com;
1480 if ((pool_id >= GKI_NUM_TOTAL_BUF_POOLS) || (!p_cb->pool_start[pool_id]))
1484 Q = &p_cb->freeq[pool_id];
1495 GKI_os_free (p_cb->pool_start[pool_id]);
1497 p_cb->pool_start[pool_id] = NULL;
1498 p_cb->pool_end[pool_id] = NULL;
1499 p_cb->pool_size[pool_id] = 0;
1502 p_cb->curr_total_no_of_pools--;