Lines Matching refs:pos

105 void setup_reachable_nodes(int pos)  in setup_reachable_nodes()  argument
111 if (m[pos][i] > channel_statistic_send) { in setup_reachable_nodes()
112 send[pos][i] = TRUE; in setup_reachable_nodes()
117 void reset_reachable_nodes(int pos) in reset_reachable_nodes() argument
120 send[pos][i] = FALSE; in reset_reachable_nodes()
124 void broadcast_data(int pos, unsigned char *buf) in broadcast_data() argument
127 if (send[pos][i] == TRUE) { in broadcast_data()
140 int pos = GPOINTER_TO_INT(user_data); in fifo_handler() local
157 if (packet_state[pos] == PACKET_START) { in fifo_handler()
161 buffer[pos][buffer_index[pos]] = *buf; in fifo_handler()
162 buffer_index[pos] += 1; in fifo_handler()
167 if (buffer_index[pos] == 0) { in fifo_handler()
170 if (packet_state[pos] == PACKET_START) { in fifo_handler()
173 setup_reachable_nodes(pos); in fifo_handler()
176 broadcast_data(pos, buf); in fifo_handler()
177 packet_state[pos] = FRAME_SIZE; in fifo_handler()
185 } else if (packet_state[pos] == FRAME_SIZE) { in fifo_handler()
186 packet_len[pos] = (int)*buf; in fifo_handler()
187 broadcast_data(pos, buf); in fifo_handler()
188 packet_state[pos] = PACKET_PSDU; in fifo_handler()
189 } else if (packet_state[pos] == PACKET_PSDU) { in fifo_handler()
190 broadcast_data(pos, buf); in fifo_handler()
191 packet_index[pos] += 1; in fifo_handler()
193 if (packet_index[pos] == packet_len[pos]) { in fifo_handler()
194 packet_state[pos] = 0; in fifo_handler()
195 packet_index[pos] = 0; in fifo_handler()
196 packet_len[pos] = 0; in fifo_handler()
197 reset_reachable_nodes(pos); in fifo_handler()
198 printf("Unlock packet %d\n", pos); in fifo_handler()
204 buffer[pos][buffer_index[pos]] = *buf; in fifo_handler()
205 buffer_index[pos] += 1; in fifo_handler()
207 for (int i = 0; i < buffer_index[pos]; ++i) { in fifo_handler()
208 *buf = buffer[pos][i]; in fifo_handler()
209 buffer[pos][i] = 0xFF; in fifo_handler()
211 if (packet_state[pos] == PACKET_START) { in fifo_handler()
214 setup_reachable_nodes(pos); in fifo_handler()
217 broadcast_data(pos, buf); in fifo_handler()
218 packet_state[pos] = FRAME_SIZE; in fifo_handler()
225 } else if (packet_state[pos] == FRAME_SIZE) { in fifo_handler()
226 packet_len[pos] = (int)*buf; in fifo_handler()
227 broadcast_data(pos, buf); in fifo_handler()
228 packet_state[pos] = PACKET_PSDU; in fifo_handler()
229 } else if (packet_state[pos] == PACKET_PSDU) { in fifo_handler()
230 broadcast_data(pos, buf); in fifo_handler()
231 packet_index[pos] += 1; in fifo_handler()
233 if (packet_index[pos] == packet_len[pos]) { in fifo_handler()
234 packet_state[pos] = 0; in fifo_handler()
235 packet_index[pos] = 0; in fifo_handler()
236 packet_len[pos] = 0; in fifo_handler()
237 reset_reachable_nodes(pos); in fifo_handler()
242 buffer_index[pos] = 0; in fifo_handler()
243 if (packet_state[pos] == PACKET_START) { in fifo_handler()
244 printf("Unlock buffer %d\n", pos); in fifo_handler()
253 static int setup_fifofd(char *pipe, int pos) in setup_fifofd() argument
272 fifo_handler, GINT_TO_POINTER(pos)); in setup_fifofd()