]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - net/atm/mpoa_caches.h
Merge remote-tracking branches 'asoc/fix/rt5663', 'asoc/fix/tlv320aic31xx' and 'asoc...
[mirror_ubuntu-bionic-kernel.git] / net / atm / mpoa_caches.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
1da177e4
LT
2#ifndef MPOA_CACHES_H
3#define MPOA_CACHES_H
4
5#include <linux/netdevice.h>
6#include <linux/types.h>
7#include <linux/atm.h>
8#include <linux/atmdev.h>
9#include <linux/atmmpc.h>
93714912 10#include <linux/refcount.h>
1da177e4
LT
11
12struct mpoa_client;
13
14void atm_mpoa_init_cache(struct mpoa_client *mpc);
15
16typedef struct in_cache_entry {
f7d57453
YH
17 struct in_cache_entry *next;
18 struct in_cache_entry *prev;
19 struct timeval tv;
20 struct timeval reply_wait;
21 struct timeval hold_down;
22 uint32_t packets_fwded;
23 uint16_t entry_state;
24 uint32_t retry_time;
25 uint32_t refresh_time;
26 uint32_t count;
27 struct atm_vcc *shortcut;
28 uint8_t MPS_ctrl_ATM_addr[ATM_ESA_LEN];
29 struct in_ctrl_info ctrl_info;
93714912 30 refcount_t use;
1da177e4
LT
31} in_cache_entry;
32
33struct in_cache_ops{
f7d57453
YH
34 in_cache_entry *(*add_entry)(__be32 dst_ip,
35 struct mpoa_client *client);
36 in_cache_entry *(*get)(__be32 dst_ip, struct mpoa_client *client);
37 in_cache_entry *(*get_with_mask)(__be32 dst_ip,
1da177e4 38 struct mpoa_client *client,
30d492da 39 __be32 mask);
f7d57453
YH
40 in_cache_entry *(*get_by_vcc)(struct atm_vcc *vcc,
41 struct mpoa_client *client);
42 void (*put)(in_cache_entry *entry);
43 void (*remove_entry)(in_cache_entry *delEntry,
1da177e4 44 struct mpoa_client *client );
f7d57453
YH
45 int (*cache_hit)(in_cache_entry *entry,
46 struct mpoa_client *client);
47 void (*clear_count)(struct mpoa_client *client);
48 void (*check_resolving)(struct mpoa_client *client);
49 void (*refresh)(struct mpoa_client *client);
50 void (*destroy_cache)(struct mpoa_client *mpc);
1da177e4
LT
51};
52
53typedef struct eg_cache_entry{
f7d57453
YH
54 struct eg_cache_entry *next;
55 struct eg_cache_entry *prev;
56 struct timeval tv;
57 uint8_t MPS_ctrl_ATM_addr[ATM_ESA_LEN];
58 struct atm_vcc *shortcut;
59 uint32_t packets_rcvd;
60 uint16_t entry_state;
61 __be32 latest_ip_addr; /* The src IP address of the last packet */
62 struct eg_ctrl_info ctrl_info;
e00bdbef 63 refcount_t use;
1da177e4
LT
64} eg_cache_entry;
65
66struct eg_cache_ops{
f7d57453
YH
67 eg_cache_entry *(*add_entry)(struct k_message *msg, struct mpoa_client *client);
68 eg_cache_entry *(*get_by_cache_id)(__be32 cache_id, struct mpoa_client *client);
69 eg_cache_entry *(*get_by_tag)(__be32 cache_id, struct mpoa_client *client);
70 eg_cache_entry *(*get_by_vcc)(struct atm_vcc *vcc, struct mpoa_client *client);
71 eg_cache_entry *(*get_by_src_ip)(__be32 ipaddr, struct mpoa_client *client);
72 void (*put)(eg_cache_entry *entry);
73 void (*remove_entry)(eg_cache_entry *entry, struct mpoa_client *client);
74 void (*update)(eg_cache_entry *entry, uint16_t holding_time);
75 void (*clear_expired)(struct mpoa_client *client);
76 void (*destroy_cache)(struct mpoa_client *mpc);
1da177e4
LT
77};
78
79
80/* Ingress cache entry states */
81
82#define INGRESS_REFRESHING 3
83#define INGRESS_RESOLVED 2
84#define INGRESS_RESOLVING 1
85#define INGRESS_INVALID 0
86
87/* VCC states */
88
89#define OPEN 1
f7d57453 90#define CLOSED 0
1da177e4
LT
91
92/* Egress cache entry states */
93
94#define EGRESS_RESOLVED 2
95#define EGRESS_PURGE 1
96#define EGRESS_INVALID 0
97
98#endif