X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fnet%2Fax25.h;h=5bd997487054c3d9125d38ca0f89f5372387164d;hb=9464c7cf61b9433057924c36e6e02f303a00e768;hp=69374cd1a857a05e1a8c8d0673afcb75f7badbfb;hpb=41689045f6a3cbe0550e1d34e9cc20d2e8c432ba;p=linux-2.6.git diff --git a/include/net/ax25.h b/include/net/ax25.h index 69374cd1a..5bd997487 100644 --- a/include/net/ax25.h +++ b/include/net/ax25.h @@ -6,6 +6,7 @@ #ifndef _AX25_H #define _AX25_H +#include #include #include #include @@ -182,26 +183,14 @@ typedef struct { typedef struct ax25_route { struct ax25_route *next; - atomic_t refcount; + atomic_t ref; ax25_address callsign; struct net_device *dev; ax25_digi *digipeat; char ip_mode; + struct timer_list timer; } ax25_route; -static inline void ax25_hold_route(ax25_route *ax25_rt) -{ - atomic_inc(&ax25_rt->refcount); -} - -extern void __ax25_put_route(ax25_route *ax25_rt); - -static inline void ax25_put_route(ax25_route *ax25_rt) -{ - if (atomic_dec_and_test(&ax25_rt->refcount)) - __ax25_put_route(ax25_rt); -} - typedef struct { char slave; /* slave_mode? */ struct timer_list slave_timer; /* timeout timer */ @@ -360,11 +349,17 @@ extern int ax25_check_iframes_acked(ax25_cb *, unsigned short); extern void ax25_rt_device_down(struct net_device *); extern int ax25_rt_ioctl(unsigned int, void __user *); extern struct file_operations ax25_route_fops; -extern ax25_route *ax25_get_route(ax25_address *addr, struct net_device *dev); extern int ax25_rt_autobind(ax25_cb *, ax25_address *); +extern ax25_route *ax25_rt_find_route(ax25_route *, ax25_address *, + struct net_device *); extern struct sk_buff *ax25_rt_build_path(struct sk_buff *, ax25_address *, ax25_address *, ax25_digi *); extern void ax25_rt_free(void); +static inline void ax25_put_route(ax25_route *ax25_rt) +{ + atomic_dec(&ax25_rt->ref); +} + /* ax25_std_in.c */ extern int ax25_std_frame_in(ax25_cb *, struct sk_buff *, int);