• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/linux/linux-2.6.36/net/atm/

Lines Matching refs:entry

27 	in_cache_entry *entry;
30 entry = client->in_cache;
31 while (entry != NULL) {
32 if (entry->ctrl_info.in_dst_ip == dst_ip) {
33 atomic_inc(&entry->use);
35 return entry;
37 entry = entry->next;
48 in_cache_entry *entry;
51 entry = client->in_cache;
52 while (entry != NULL) {
53 if ((entry->ctrl_info.in_dst_ip & mask) == (dst_ip & mask)) {
54 atomic_inc(&entry->use);
56 return entry;
58 entry = entry->next;
69 in_cache_entry *entry;
72 entry = client->in_cache;
73 while (entry != NULL) {
74 if (entry->shortcut == vcc) {
75 atomic_inc(&entry->use);
77 return entry;
79 entry = entry->next;
89 in_cache_entry *entry = kzalloc(sizeof(in_cache_entry), GFP_KERNEL);
91 if (entry == NULL) {
96 dprintk("adding an ingress entry, ip = %pI4\n", &dst_ip);
98 atomic_set(&entry->use, 1);
101 entry->next = client->in_cache;
102 entry->prev = NULL;
104 client->in_cache->prev = entry;
105 client->in_cache = entry;
107 memcpy(entry->MPS_ctrl_ATM_addr, client->mps_ctrl_addr, ATM_ESA_LEN);
108 entry->ctrl_info.in_dst_ip = dst_ip;
109 do_gettimeofday(&(entry->tv));
110 entry->retry_time = client->parameters.mpc_p4;
111 entry->count = 1;
112 entry->entry_state = INGRESS_INVALID;
113 entry->ctrl_info.holding_time = HOLDING_TIME_DEFAULT;
114 atomic_inc(&entry->use);
119 return entry;
122 static int cache_hit(in_cache_entry *entry, struct mpoa_client *mpc)
127 entry->count++;
128 if (entry->entry_state == INGRESS_RESOLVED && entry->shortcut != NULL)
131 if (entry->entry_state == INGRESS_REFRESHING) {
132 if (entry->count > mpc->parameters.mpc_p1) {
134 msg.content.in_info = entry->ctrl_info;
136 qos = atm_mpoa_search_qos(entry->ctrl_info.in_dst_ip);
140 do_gettimeofday(&(entry->reply_wait));
141 entry->entry_state = INGRESS_RESOLVING;
143 if (entry->shortcut != NULL)
148 if (entry->entry_state == INGRESS_RESOLVING && entry->shortcut != NULL)
151 if (entry->count > mpc->parameters.mpc_p1 &&
152 entry->entry_state == INGRESS_INVALID) {
154 mpc->dev->name, &entry->ctrl_info.in_dst_ip);
155 entry->entry_state = INGRESS_RESOLVING;
158 msg.content.in_info = entry->ctrl_info;
159 qos = atm_mpoa_search_qos(entry->ctrl_info.in_dst_ip);
163 do_gettimeofday(&(entry->reply_wait));
169 static void in_cache_put(in_cache_entry *entry)
171 if (atomic_dec_and_test(&entry->use)) {
172 memset(entry, 0, sizeof(in_cache_entry));
173 kfree(entry);
180 static void in_cache_remove_entry(in_cache_entry *entry,
186 vcc = entry->shortcut;
187 dprintk("removing an ingress entry, ip = %pI4\n",
188 &entry->ctrl_info.in_dst_ip);
190 if (entry->prev != NULL)
191 entry->prev->next = entry->next;
193 client->in_cache = entry->next;
194 if (entry->next != NULL)
195 entry->next->prev = entry->prev;
196 client->in_ops->put(entry);
218 in_cache_entry *entry, *next_entry;
224 entry = client->in_cache;
225 while (entry != NULL) {
226 entry->count = 0;
227 next_entry = entry->next;
228 if ((now.tv_sec - entry->tv.tv_sec)
229 > entry->ctrl_info.holding_time) {
231 &entry->ctrl_info.in_dst_ip);
232 client->in_ops->remove_entry(entry, client);
234 entry = next_entry;
244 in_cache_entry *entry;
251 entry = client->in_cache;
252 while (entry != NULL) {
253 if (entry->entry_state == INGRESS_RESOLVING) {
254 if ((now.tv_sec - entry->hold_down.tv_sec) <
256 entry = entry->next; /* Entry in hold down */
259 if ((now.tv_sec - entry->reply_wait.tv_sec) >
260 entry->retry_time) {
261 entry->retry_time = MPC_C1 * (entry->retry_time);
264 * put entry in hold down.
266 if (entry->retry_time > client->parameters.mpc_p5) {
267 do_gettimeofday(&(entry->hold_down));
268 entry->retry_time = client->parameters.mpc_p4;
269 entry = entry->next;
273 memset(&(entry->hold_down), 0, sizeof(struct timeval));
276 msg.content.in_info = entry->ctrl_info;
277 qos = atm_mpoa_search_qos(entry->ctrl_info.in_dst_ip);
281 do_gettimeofday(&(entry->reply_wait));
284 entry = entry->next;
293 struct in_cache_entry *entry = client->in_cache;
299 while (entry != NULL) {
300 if (entry->entry_state == INGRESS_RESOLVED) {
301 if (!(entry->refresh_time))
302 entry->refresh_time = (2 * (entry->ctrl_info.holding_time))/3;
303 if ((now.tv_sec - entry->reply_wait.tv_sec) >
304 entry->refresh_time) {
305 dprintk("refreshing an entry.\n");
306 entry->entry_state = INGRESS_REFRESHING;
310 entry = entry->next;
326 eg_cache_entry *entry;
329 entry = mpc->eg_cache;
330 while (entry != NULL) {
331 if (entry->ctrl_info.cache_id == cache_id) {
332 atomic_inc(&entry->use);
334 return entry;
336 entry = entry->next;
347 eg_cache_entry *entry;
350 entry = mpc->eg_cache;
351 while (entry != NULL) {
352 if (entry->ctrl_info.tag == tag) {
353 atomic_inc(&entry->use);
355 return entry;
357 entry = entry->next;
369 eg_cache_entry *entry;
372 entry = mpc->eg_cache;
373 while (entry != NULL) {
374 if (entry->shortcut == vcc) {
375 atomic_inc(&entry->use);
377 return entry;
379 entry = entry->next;
389 eg_cache_entry *entry;
392 entry = mpc->eg_cache;
393 while (entry != NULL) {
394 if (entry->latest_ip_addr == ipaddr) {
395 atomic_inc(&entry->use);
397 return entry;
399 entry = entry->next;
406 static void eg_cache_put(eg_cache_entry *entry)
408 if (atomic_dec_and_test(&entry->use)) {
409 memset(entry, 0, sizeof(eg_cache_entry));
410 kfree(entry);
417 static void eg_cache_remove_entry(eg_cache_entry *entry,
423 vcc = entry->shortcut;
424 dprintk("removing an egress entry.\n");
425 if (entry->prev != NULL)
426 entry->prev->next = entry->next;
428 client->eg_cache = entry->next;
429 if (entry->next != NULL)
430 entry->next->prev = entry->prev;
431 client->eg_ops->put(entry);
451 eg_cache_entry *entry = kzalloc(sizeof(eg_cache_entry), GFP_KERNEL);
453 if (entry == NULL) {
458 dprintk("adding an egress entry, ip = %pI4, this should be our IP\n",
461 atomic_set(&entry->use, 1);
464 entry->next = client->eg_cache;
465 entry->prev = NULL;
467 client->eg_cache->prev = entry;
468 client->eg_cache = entry;
470 memcpy(entry->MPS_ctrl_ATM_addr, client->mps_ctrl_addr, ATM_ESA_LEN);
471 entry->ctrl_info = msg->content.eg_info;
472 do_gettimeofday(&(entry->tv));
473 entry->entry_state = EGRESS_RESOLVED;
475 ntohl(entry->ctrl_info.cache_id));
476 dprintk("mps_ip = %pI4\n", &entry->ctrl_info.mps_ip);
477 atomic_inc(&entry->use);
482 return entry;
485 static void update_eg_cache_entry(eg_cache_entry *entry, uint16_t holding_time)
487 do_gettimeofday(&(entry->tv));
488 entry->entry_state = EGRESS_RESOLVED;
489 entry->ctrl_info.holding_time = holding_time;
494 eg_cache_entry *entry, *next_entry;
501 entry = client->eg_cache;
502 while (entry != NULL) {
503 next_entry = entry->next;
504 if ((now.tv_sec - entry->tv.tv_sec)
505 > entry->ctrl_info.holding_time) {
507 msg.content.eg_info = entry->ctrl_info;
509 ntohl(entry->ctrl_info.cache_id));
511 client->eg_ops->remove_entry(entry, client);
513 entry = next_entry;