From 5dde431ab11464fd34afb89df7834a3587a2bacb Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 27 Dec 2004 02:23:16 -0800 Subject: [APPLETALK]: Make some code static. Signed-off-by: Adrian Bunk Signed-off-by: David S. Miller --- include/linux/atalk.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/linux/atalk.h b/include/linux/atalk.h index 2a9b82002591..f5cdd69497bc 100644 --- a/include/linux/atalk.h +++ b/include/linux/atalk.h @@ -188,8 +188,6 @@ extern struct net_device *atrtr_get_dev(struct atalk_addr *sa); extern int aarp_send_ddp(struct net_device *dev, struct sk_buff *skb, struct atalk_addr *sa, void *hwaddr); -extern void aarp_send_probe(struct net_device *dev, - struct atalk_addr *addr); extern void aarp_device_down(struct net_device *dev); extern void aarp_probe_network(struct atalk_iface *atif); extern int aarp_proxy_probe_network(struct atalk_iface *atif, -- cgit v1.2.3 From 7206f627dec7e1ead78f8ad723af1eb6b193e023 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 27 Dec 2004 02:24:18 -0800 Subject: [AX25]: Staticize functions, and remove unused global function. Signed-off-by: Adrian Bunk Signed-off-by: David S. Miller --- include/net/ax25.h | 3 --- net/ax25/af_ax25.c | 2 +- net/ax25/ax25_addr.c | 20 -------------------- net/ax25/ax25_ds_subr.c | 2 +- 4 files changed, 2 insertions(+), 25 deletions(-) (limited to 'include') diff --git a/include/net/ax25.h b/include/net/ax25.h index bf86bf67bdb9..ab43611b59ba 100644 --- a/include/net/ax25.h +++ b/include/net/ax25.h @@ -231,7 +231,6 @@ extern void ax25_send_to_raw(ax25_address *, struct sk_buff *, int); extern void ax25_destroy_socket(ax25_cb *); extern ax25_cb *ax25_create_cb(void); extern void ax25_fillin_cb(ax25_cb *, ax25_dev *); -extern int ax25_create(struct socket *, int); extern struct sock *ax25_make_new(struct sock *, struct ax25_dev *); /* ax25_addr.c */ @@ -239,7 +238,6 @@ extern ax25_address null_ax25_address; extern char *ax2asc(ax25_address *); extern ax25_address *asc2ax(char *); extern int ax25cmp(ax25_address *, ax25_address *); -extern int ax25digicmp(ax25_digi *, ax25_digi *); extern unsigned char *ax25_addr_parse(unsigned char *, int, ax25_address *, ax25_address *, ax25_digi *, int *, int *); extern int ax25_addr_build(unsigned char *, ax25_address *, ax25_address *, ax25_digi *, int, int); extern int ax25_addr_size(ax25_digi *); @@ -268,7 +266,6 @@ extern int ax25_ds_frame_in(ax25_cb *, struct sk_buff *, int); extern void ax25_ds_nr_error_recovery(ax25_cb *); extern void ax25_ds_enquiry_response(ax25_cb *); extern void ax25_ds_establish_data_link(ax25_cb *); -extern void ax25_dev_dama_on(ax25_dev *); extern void ax25_dev_dama_off(ax25_dev *); extern void ax25_dama_on(ax25_cb *); extern void ax25_dama_off(ax25_cb *); diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c index 8d1315ffdcd0..1d7b66a457f9 100644 --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c @@ -755,7 +755,7 @@ out: return res; } -int ax25_create(struct socket *sock, int protocol) +static int ax25_create(struct socket *sock, int protocol) { struct sock *sk; ax25_cb *ax25; diff --git a/net/ax25/ax25_addr.c b/net/ax25/ax25_addr.c index f4fa6dfb846e..4db0a89c4b3b 100644 --- a/net/ax25/ax25_addr.c +++ b/net/ax25/ax25_addr.c @@ -120,26 +120,6 @@ int ax25cmp(ax25_address *a, ax25_address *b) return 2; /* Partial match */ } -/* - * Compare two AX.25 digipeater paths. - */ -int ax25digicmp(ax25_digi *digi1, ax25_digi *digi2) -{ - int i; - - if (digi1->ndigi != digi2->ndigi) - return 1; - - if (digi1->lastrepeat != digi2->lastrepeat) - return 1; - - for (i = 0; i < digi1->ndigi; i++) - if (ax25cmp(&digi1->calls[i], &digi2->calls[i]) != 0) - return 1; - - return 0; -} - /* * Given an AX.25 address pull of to, from, digi list, command/response and the start of data * diff --git a/net/ax25/ax25_ds_subr.c b/net/ax25/ax25_ds_subr.c index 89c07ce023f2..10ffd2beba3f 100644 --- a/net/ax25/ax25_ds_subr.c +++ b/net/ax25/ax25_ds_subr.c @@ -174,7 +174,7 @@ static int ax25_check_dama_slave(ax25_dev *ax25_dev) return res; } -void ax25_dev_dama_on(ax25_dev *ax25_dev) +static void ax25_dev_dama_on(ax25_dev *ax25_dev) { if (ax25_dev == NULL) return; -- cgit v1.2.3 From ca2628e3ffa30bc118dd87e86e2d7856006b6cc6 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 27 Dec 2004 02:25:23 -0800 Subject: [NET]: No need to export sock_readv_writev Signed-off-by: Adrian Bunk Signed-off-by: David S. Miller --- include/linux/net.h | 4 ---- net/socket.c | 5 +++-- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/linux/net.h b/include/linux/net.h index 368b0f9d3006..8bfb1243f5e2 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -187,10 +187,6 @@ extern int sock_sendmsg(struct socket *sock, struct msghdr *msg, size_t len); extern int sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t size, int flags); -extern int sock_readv_writev(int type, struct inode *inode, - struct file *file, - const struct iovec *iov, long count, - size_t size); extern int sock_map_fd(struct socket *sock); extern struct socket *sockfd_lookup(int fd, int *err); #define sockfd_put(sock) fput(sock->file) diff --git a/net/socket.c b/net/socket.c index 45aada9314a1..dff6156dd4f8 100644 --- a/net/socket.c +++ b/net/socket.c @@ -736,8 +736,9 @@ ssize_t sock_sendpage(struct file *file, struct page *page, return sock->ops->sendpage(sock, page, offset, size, flags); } -int sock_readv_writev(int type, struct inode * inode, struct file * file, - const struct iovec * iov, long count, size_t size) +static int sock_readv_writev(int type, struct inode * inode, + struct file * file, const struct iovec * iov, + long count, size_t size) { struct msghdr msg; struct socket *sock; -- cgit v1.2.3 From 4d9caa15d23cc2891c4509b8337935ab4c2cab40 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 27 Dec 2004 02:29:36 -0800 Subject: [SUNRPC]: Staticize, kill unused functions, and remove unneeded exports. Signed-off-by: Adrian Bunk Signed-off-by: David S. Miller --- include/linux/sunrpc/auth.h | 2 - include/linux/sunrpc/cache.h | 5 -- include/linux/sunrpc/gss_asn1.h | 2 - include/linux/sunrpc/sched.h | 1 - include/linux/sunrpc/xdr.h | 6 -- include/linux/sunrpc/xprt.h | 3 - net/sunrpc/auth.c | 2 +- net/sunrpc/auth_gss/auth_gss.c | 2 +- net/sunrpc/auth_gss/gss_generic_token.c | 35 --------- net/sunrpc/auth_gss/gss_krb5_crypto.c | 2 +- net/sunrpc/auth_gss/gss_krb5_mech.c | 3 - net/sunrpc/auth_gss/gss_spkm3_mech.c | 9 +-- net/sunrpc/auth_gss/svcauth_gss.c | 4 +- net/sunrpc/cache.c | 41 +++------- net/sunrpc/pmap_clnt.c | 4 +- net/sunrpc/rpc_pipe.c | 9 +-- net/sunrpc/sched.c | 5 +- net/sunrpc/sunrpc_syms.c | 1 - net/sunrpc/svcauth.c | 3 +- net/sunrpc/svcauth_unix.c | 6 +- net/sunrpc/xdr.c | 133 +------------------------------- net/sunrpc/xprt.c | 8 +- 22 files changed, 38 insertions(+), 248 deletions(-) (limited to 'include') diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index a196e9b76793..97976c431d0b 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h @@ -114,8 +114,6 @@ extern struct rpc_authops authnull_ops; extern struct rpc_authops authdes_ops; #endif -u32 pseudoflavor_to_flavor(rpc_authflavor_t); - int rpcauth_register(struct rpc_authops *); int rpcauth_unregister(struct rpc_authops *); struct rpc_auth * rpcauth_create(rpc_authflavor_t, struct rpc_clnt *); diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index 04ac3afcc6a9..b902425d2be5 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h @@ -257,8 +257,6 @@ RTN *FNAME ARGS \ -extern void cache_defer_req(struct cache_req *req, struct cache_head *item); -extern void cache_revisit_request(struct cache_head *item); extern void cache_clean_deferred(void *owner); static inline struct cache_head *cache_get(struct cache_head *h) @@ -286,14 +284,11 @@ extern void cache_fresh(struct cache_detail *detail, struct cache_head *head, time_t expiry); extern int cache_check(struct cache_detail *detail, struct cache_head *h, struct cache_req *rqstp); -extern int cache_clean(void); extern void cache_flush(void); extern void cache_purge(struct cache_detail *detail); #define NEVER (0x7FFFFFFF) extern void cache_register(struct cache_detail *cd); extern int cache_unregister(struct cache_detail *cd); -extern struct cache_detail *cache_find(char *name); -extern void cache_drop(struct cache_detail *detail); extern void qword_add(char **bpp, int *lp, char *str); extern void qword_addhex(char **bpp, int *lp, char *buf, int blen); diff --git a/include/linux/sunrpc/gss_asn1.h b/include/linux/sunrpc/gss_asn1.h index e0e4e1dc5656..3ccecd0ad229 100644 --- a/include/linux/sunrpc/gss_asn1.h +++ b/include/linux/sunrpc/gss_asn1.h @@ -71,8 +71,6 @@ u32 g_verify_token_header( unsigned char **buf_in, int toksize); -u32 g_get_mech_oid(struct xdr_netobj *mech, struct xdr_netobj * in_buf); - int g_token_size( struct xdr_netobj *mech, unsigned int body_size); diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 6959ed0d69d8..71d710450e84 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h @@ -222,7 +222,6 @@ struct rpc_task *rpc_wake_up_next(struct rpc_wait_queue *); void rpc_wake_up_status(struct rpc_wait_queue *, int); void rpc_delay(struct rpc_task *, unsigned long); void * rpc_malloc(struct rpc_task *, size_t); -void rpc_free(struct rpc_task *); int rpciod_up(void); void rpciod_down(void); void rpciod_wake_up(void); diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index 112738cca4e1..541dcf838abf 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h @@ -95,7 +95,6 @@ u32 * xdr_decode_string(u32 *p, char **sp, int *lenp, int maxlen); u32 * xdr_decode_string_inplace(u32 *p, char **sp, int *lenp, int maxlen); u32 * xdr_encode_netobj(u32 *p, const struct xdr_netobj *); u32 * xdr_decode_netobj(u32 *p, struct xdr_netobj *); -u32 * xdr_decode_netobj_fixed(u32 *p, void *obj, unsigned int len); void xdr_encode_pages(struct xdr_buf *, struct page **, unsigned int, unsigned int); @@ -135,8 +134,6 @@ xdr_adjust_iovec(struct kvec *iov, u32 *p) return iov->iov_len = ((u8 *) p - (u8 *) iov->iov_base); } -void xdr_shift_iovec(struct kvec *, int, size_t); - /* * Maximum number of iov's we use. */ @@ -145,10 +142,7 @@ void xdr_shift_iovec(struct kvec *, int, size_t); /* * XDR buffer helper functions */ -extern int xdr_kmap(struct kvec *, struct xdr_buf *, size_t); -extern void xdr_kunmap(struct xdr_buf *, size_t); extern void xdr_shift_buf(struct xdr_buf *, size_t); -extern void _copy_from_pages(char *, struct page **, size_t, size_t); extern void xdr_buf_from_iov(struct kvec *, struct xdr_buf *); extern int xdr_buf_subsegment(struct xdr_buf *, struct xdr_buf *, int, int); extern int xdr_buf_read_netobj(struct xdr_buf *, struct xdr_netobj *, int); diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 298b18486729..78dbc7bedd7b 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h @@ -201,8 +201,6 @@ struct rpc_xprt { struct rpc_xprt * xprt_create_proto(int proto, struct sockaddr_in *addr, struct rpc_timeout *toparms); int xprt_destroy(struct rpc_xprt *); -void xprt_shutdown(struct rpc_xprt *); -void xprt_default_timeout(struct rpc_timeout *, int); void xprt_set_timeout(struct rpc_timeout *, unsigned int, unsigned long); @@ -213,7 +211,6 @@ void xprt_receive(struct rpc_task *); int xprt_adjust_timeout(struct rpc_rqst *req); void xprt_release(struct rpc_task *); void xprt_connect(struct rpc_task *); -int xprt_clear_backlog(struct rpc_xprt *); void xprt_sock_setbufsize(struct rpc_xprt *); #define XPRT_LOCKED 0 diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c index 315b16247b8c..91d325e62953 100644 --- a/net/sunrpc/auth.c +++ b/net/sunrpc/auth.c @@ -25,7 +25,7 @@ static struct rpc_authops * auth_flavors[RPC_AUTH_MAXFLAVOR] = { NULL, /* others can be loadable modules */ }; -u32 +static u32 pseudoflavor_to_flavor(u32 flavor) { if (flavor >= RPC_AUTH_MAXFLAVOR) return RPC_AUTH_GSS; diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c index 927b72c89fb3..a6260098e836 100644 --- a/net/sunrpc/auth_gss/auth_gss.c +++ b/net/sunrpc/auth_gss/auth_gss.c @@ -532,7 +532,7 @@ gss_pipe_release(struct inode *inode) spin_unlock(&gss_auth->lock); } -void +static void gss_pipe_destroy_msg(struct rpc_pipe_msg *msg) { struct gss_upcall_msg *gss_msg = container_of(msg, struct gss_upcall_msg, msg); diff --git a/net/sunrpc/auth_gss/gss_generic_token.c b/net/sunrpc/auth_gss/gss_generic_token.c index b0951d11522a..826df44e7fca 100644 --- a/net/sunrpc/auth_gss/gss_generic_token.c +++ b/net/sunrpc/auth_gss/gss_generic_token.c @@ -233,38 +233,3 @@ g_verify_token_header(struct xdr_netobj *mech, int *body_size, EXPORT_SYMBOL(g_verify_token_header); -/* Given a buffer containing a token, returns a copy of the mech oid in - * the parameter mech. */ -u32 -g_get_mech_oid(struct xdr_netobj *mech, struct xdr_netobj * in_buf) -{ - unsigned char *buf = in_buf->data; - int len = in_buf->len; - int ret=0; - int seqsize; - - if ((len-=1) < 0) - return(G_BAD_TOK_HEADER); - if (*buf++ != 0x60) - return(G_BAD_TOK_HEADER); - - if ((seqsize = der_read_length(&buf, &len)) < 0) - return(G_BAD_TOK_HEADER); - - if ((len-=1) < 0) - return(G_BAD_TOK_HEADER); - if (*buf++ != 0x06) - return(G_BAD_TOK_HEADER); - - if ((len-=1) < 0) - return(G_BAD_TOK_HEADER); - mech->len = *buf++; - - if ((len-=mech->len) < 0) - return(G_BAD_TOK_HEADER); - if (!(mech->data = kmalloc(mech->len, GFP_KERNEL))) - return(G_BUFFER_ALLOC); - memcpy(mech->data, buf, mech->len); - - return ret; -} diff --git a/net/sunrpc/auth_gss/gss_krb5_crypto.c b/net/sunrpc/auth_gss/gss_krb5_crypto.c index b4db91868bb8..24c21f2a33a7 100644 --- a/net/sunrpc/auth_gss/gss_krb5_crypto.c +++ b/net/sunrpc/auth_gss/gss_krb5_crypto.c @@ -132,7 +132,7 @@ out: EXPORT_SYMBOL(krb5_decrypt); -void +static void buf_to_sg(struct scatterlist *sg, char *ptr, int len) { sg->page = virt_to_page(ptr); sg->offset = offset_in_page(ptr); diff --git a/net/sunrpc/auth_gss/gss_krb5_mech.c b/net/sunrpc/auth_gss/gss_krb5_mech.c index 0082fb5c999a..a734dd869518 100644 --- a/net/sunrpc/auth_gss/gss_krb5_mech.c +++ b/net/sunrpc/auth_gss/gss_krb5_mech.c @@ -48,9 +48,6 @@ # define RPCDBG_FACILITY RPCDBG_AUTH #endif -struct xdr_netobj gss_mech_krb5_oid = - {9, "\052\206\110\206\367\022\001\002\002"}; - static inline int get_bytes(char **ptr, const char *end, void *res, int len) { diff --git a/net/sunrpc/auth_gss/gss_spkm3_mech.c b/net/sunrpc/auth_gss/gss_spkm3_mech.c index 2887de1cae1c..fd213dc36093 100644 --- a/net/sunrpc/auth_gss/gss_spkm3_mech.c +++ b/net/sunrpc/auth_gss/gss_spkm3_mech.c @@ -49,9 +49,6 @@ # define RPCDBG_FACILITY RPCDBG_AUTH #endif -struct xdr_netobj gss_mech_spkm3_oid = - {7, "\053\006\001\005\005\001\003"}; - static inline int get_bytes(char **ptr, const char *end, void *res, int len) { @@ -206,7 +203,7 @@ out_err: return GSS_S_FAILURE; } -void +static void gss_delete_sec_context_spkm3(void *internal_ctx) { struct spkm3_ctx *sctx = internal_ctx; @@ -221,7 +218,7 @@ gss_delete_sec_context_spkm3(void *internal_ctx) { kfree(sctx); } -u32 +static u32 gss_verify_mic_spkm3(struct gss_ctx *ctx, struct xdr_buf *signbuf, struct xdr_netobj *checksum, @@ -241,7 +238,7 @@ gss_verify_mic_spkm3(struct gss_ctx *ctx, return maj_stat; } -u32 +static u32 gss_get_mic_spkm3(struct gss_ctx *ctx, u32 qop, struct xdr_buf *message_buffer, diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index ee2e9cef94c2..43096520a604 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c @@ -448,7 +448,7 @@ static struct cache_detail rsc_cache = { static DefineSimpleCacheLookup(rsc, 0); -struct rsc * +static struct rsc * gss_svc_searchbyctx(struct xdr_netobj *handle) { struct rsc rsci; @@ -1045,7 +1045,7 @@ svcauth_gss_domain_release(struct auth_domain *dom) kfree(gd); } -struct auth_ops svcauthops_gss = { +static struct auth_ops svcauthops_gss = { .name = "rpcsec_gss", .owner = THIS_MODULE, .flavour = RPC_AUTH_GSS, diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c index d508a513d632..8845b9e3d735 100644 --- a/net/sunrpc/cache.c +++ b/net/sunrpc/cache.c @@ -33,6 +33,9 @@ #define RPCDBG_FACILITY RPCDBG_CACHE +static void cache_defer_req(struct cache_req *req, struct cache_head *item); +static void cache_revisit_request(struct cache_head *item); + void cache_init(struct cache_head *h) { time_t now = get_seconds(); @@ -256,39 +259,13 @@ int cache_unregister(struct cache_detail *cd) return 0; } -struct cache_detail *cache_find(char *name) -{ - struct list_head *l; - - spin_lock(&cache_list_lock); - list_for_each(l, &cache_list) { - struct cache_detail *cd = list_entry(l, struct cache_detail, others); - - if (strcmp(cd->name, name)==0) { - atomic_inc(&cd->inuse); - spin_unlock(&cache_list_lock); - return cd; - } - } - spin_unlock(&cache_list_lock); - return NULL; -} - -/* cache_drop must be called on any cache returned by - * cache_find, after it has been used - */ -void cache_drop(struct cache_detail *detail) -{ - atomic_dec(&detail->inuse); -} - /* clean cache tries to find something to clean * and cleans it. * It returns 1 if it cleaned something, * 0 if it didn't find anything this time * -1 if it fell off the end of the list. */ -int cache_clean(void) +static int cache_clean(void) { int rv = 0; struct list_head *next; @@ -428,12 +405,12 @@ void cache_purge(struct cache_detail *detail) #define DFR_MAX 300 /* ??? */ -spinlock_t cache_defer_lock = SPIN_LOCK_UNLOCKED; +static spinlock_t cache_defer_lock = SPIN_LOCK_UNLOCKED; static LIST_HEAD(cache_defer_list); static struct list_head cache_defer_hash[DFR_HASHSIZE]; static int cache_defer_cnt; -void cache_defer_req(struct cache_req *req, struct cache_head *item) +static void cache_defer_req(struct cache_req *req, struct cache_head *item) { struct cache_deferred_req *dreq; int hash = DFR_HASH(item); @@ -483,7 +460,7 @@ void cache_defer_req(struct cache_req *req, struct cache_head *item) } } -void cache_revisit_request(struct cache_head *item) +static void cache_revisit_request(struct cache_head *item) { struct cache_deferred_req *dreq; struct list_head pending; @@ -902,7 +879,7 @@ void qword_addhex(char **bpp, int *lp, char *buf, int blen) *lp = len; } -void warn_no_listener(struct cache_detail *detail) +static void warn_no_listener(struct cache_detail *detail) { if (detail->last_warn != detail->last_close) { detail->last_warn = detail->last_close; @@ -1119,7 +1096,7 @@ static int c_show(struct seq_file *m, void *p) return cd->cache_show(m, cd, cp); } -struct seq_operations cache_content_op = { +static struct seq_operations cache_content_op = { .start = c_start, .next = c_next, .stop = c_stop, diff --git a/net/sunrpc/pmap_clnt.c b/net/sunrpc/pmap_clnt.c index 61bdc9754a06..5e157d65bbe7 100644 --- a/net/sunrpc/pmap_clnt.c +++ b/net/sunrpc/pmap_clnt.c @@ -31,7 +31,7 @@ static struct rpc_procinfo pmap_procedures[]; static struct rpc_clnt * pmap_create(char *, struct sockaddr_in *, int); static void pmap_getport_done(struct rpc_task *); -extern struct rpc_program pmap_program; +static struct rpc_program pmap_program; static spinlock_t pmap_lock = SPIN_LOCK_UNLOCKED; /* @@ -292,7 +292,7 @@ static struct rpc_version * pmap_version[] = { static struct rpc_stat pmap_stats; -struct rpc_program pmap_program = { +static struct rpc_program pmap_program = { .name = "portmap", .number = RPC_PMAP_PROGRAM, .nrvers = ARRAY_SIZE(pmap_version), diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index 11872a8a94be..7b3d9647671f 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c @@ -276,12 +276,7 @@ rpc_pipe_ioctl(struct inode *ino, struct file *filp, } } -struct inode_operations rpc_pipe_iops = { - .lookup = simple_lookup, -}; - - -struct file_operations rpc_pipe_fops = { +static struct file_operations rpc_pipe_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .read = rpc_pipe_read, @@ -595,7 +590,7 @@ __rpc_rmdir(struct inode *dir, struct dentry *dentry) return 0; } -struct dentry * +static struct dentry * rpc_lookup_negative(char *path, struct nameidata *nd) { struct dentry *dentry; diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c index aa2205a2c19a..c5c8d5d59a0f 100644 --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c @@ -42,6 +42,9 @@ static mempool_t *rpc_buffer_mempool; static void __rpc_default_timer(struct rpc_task *task); static void rpciod_killall(void); +static void rpc_free(struct rpc_task *task); + + /* * When an asynchronous RPC task is activated within a bottom half * handler, or while executing another RPC task, it is put on @@ -837,7 +840,7 @@ rpc_malloc(struct rpc_task *task, size_t size) return task->tk_buffer; } -void +static void rpc_free(struct rpc_task *task) { if (task->tk_buffer) { diff --git a/net/sunrpc/sunrpc_syms.c b/net/sunrpc/sunrpc_syms.c index 51f0392ae531..1876751172be 100644 --- a/net/sunrpc/sunrpc_syms.c +++ b/net/sunrpc/sunrpc_syms.c @@ -107,7 +107,6 @@ EXPORT_SYMBOL(auth_unix_add_addr); EXPORT_SYMBOL(auth_unix_forget_old); EXPORT_SYMBOL(auth_unix_lookup); EXPORT_SYMBOL(cache_check); -EXPORT_SYMBOL(cache_clean); EXPORT_SYMBOL(cache_flush); EXPORT_SYMBOL(cache_purge); EXPORT_SYMBOL(cache_fresh); diff --git a/net/sunrpc/svcauth.c b/net/sunrpc/svcauth.c index d9f09e61d83c..8a659ac5143a 100644 --- a/net/sunrpc/svcauth.c +++ b/net/sunrpc/svcauth.c @@ -128,7 +128,8 @@ EXPORT_SYMBOL(svc_auth_unregister); #define DN_HASHMASK (DN_HASHMAX-1) static struct cache_head *auth_domain_table[DN_HASHMAX]; -void auth_domain_drop(struct cache_head *item, struct cache_detail *cd) + +static void auth_domain_drop(struct cache_head *item, struct cache_detail *cd) { struct auth_domain *dom = container_of(item, struct auth_domain, h); if (cache_put(item,cd)) diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c index 2832312483ed..043eb46c7fba 100644 --- a/net/sunrpc/svcauth_unix.c +++ b/net/sunrpc/svcauth_unix.c @@ -97,7 +97,7 @@ struct ip_map { }; static struct cache_head *ip_table[IP_HASHMAX]; -void ip_map_put(struct cache_head *item, struct cache_detail *cd) +static void ip_map_put(struct cache_head *item, struct cache_detail *cd) { struct ip_map *im = container_of(item, struct ip_map,h); if (cache_put(item, cd)) { @@ -417,7 +417,7 @@ struct auth_ops svcauth_null = { }; -int +static int svcauth_unix_accept(struct svc_rqst *rqstp, u32 *authp) { struct kvec *argv = &rqstp->rq_arg.head[0]; @@ -497,7 +497,7 @@ badcred: return SVC_DENIED; } -int +static int svcauth_unix_release(struct svc_rqst *rqstp) { /* Verifier (such as it is) is already in place. diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c index a6630a1f2025..0b42059378cb 100644 --- a/net/sunrpc/xdr.c +++ b/net/sunrpc/xdr.c @@ -32,15 +32,6 @@ xdr_encode_netobj(u32 *p, const struct xdr_netobj *obj) return p + XDR_QUADLEN(obj->len); } -u32 * -xdr_decode_netobj_fixed(u32 *p, void *obj, unsigned int len) -{ - if (ntohl(*p++) != len) - return NULL; - memcpy(obj, p, len); - return p + XDR_QUADLEN(len); -} - u32 * xdr_decode_netobj(u32 *p, struct xdr_netobj *obj) { @@ -185,124 +176,6 @@ xdr_inline_pages(struct xdr_buf *xdr, unsigned int offset, xdr->buflen += len; } -/* - * Realign the kvec if the server missed out some reply elements - * (such as post-op attributes,...) - * Note: This is a simple implementation that assumes that - * len <= iov->iov_len !!! - * The RPC header (assumed to be the 1st element in the iov array) - * is not shifted. - */ -void xdr_shift_iovec(struct kvec *iov, int nr, size_t len) -{ - struct kvec *pvec; - - for (pvec = iov + nr - 1; nr > 1; nr--, pvec--) { - struct kvec *svec = pvec - 1; - - if (len > pvec->iov_len) { - printk(KERN_DEBUG "RPC: Urk! Large shift of short iovec.\n"); - return; - } - memmove((char *)pvec->iov_base + len, pvec->iov_base, - pvec->iov_len - len); - - if (len > svec->iov_len) { - printk(KERN_DEBUG "RPC: Urk! Large shift of short iovec.\n"); - return; - } - memcpy(pvec->iov_base, - (char *)svec->iov_base + svec->iov_len - len, len); - } -} - -/* - * Map a struct xdr_buf into an kvec array. - */ -int xdr_kmap(struct kvec *iov_base, struct xdr_buf *xdr, size_t base) -{ - struct kvec *iov = iov_base; - struct page **ppage = xdr->pages; - unsigned int len, pglen = xdr->page_len; - - len = xdr->head[0].iov_len; - if (base < len) { - iov->iov_len = len - base; - iov->iov_base = (char *)xdr->head[0].iov_base + base; - iov++; - base = 0; - } else - base -= len; - - if (pglen == 0) - goto map_tail; - if (base >= pglen) { - base -= pglen; - goto map_tail; - } - if (base || xdr->page_base) { - pglen -= base; - base += xdr->page_base; - ppage += base >> PAGE_CACHE_SHIFT; - base &= ~PAGE_CACHE_MASK; - } - do { - len = PAGE_CACHE_SIZE; - iov->iov_base = kmap(*ppage); - if (base) { - iov->iov_base += base; - len -= base; - base = 0; - } - if (pglen < len) - len = pglen; - iov->iov_len = len; - iov++; - ppage++; - } while ((pglen -= len) != 0); -map_tail: - if (xdr->tail[0].iov_len) { - iov->iov_len = xdr->tail[0].iov_len - base; - iov->iov_base = (char *)xdr->tail[0].iov_base + base; - iov++; - } - return (iov - iov_base); -} - -void xdr_kunmap(struct xdr_buf *xdr, size_t base) -{ - struct page **ppage = xdr->pages; - unsigned int pglen = xdr->page_len; - - if (!pglen) - return; - if (base > xdr->head[0].iov_len) - base -= xdr->head[0].iov_len; - else - base = 0; - - if (base >= pglen) - return; - if (base || xdr->page_base) { - pglen -= base; - base += xdr->page_base; - ppage += base >> PAGE_CACHE_SHIFT; - /* Note: The offset means that the length of the first - * page is really (PAGE_CACHE_SIZE - (base & ~PAGE_CACHE_MASK)). - * In order to avoid an extra test inside the loop, - * we bump pglen here, and just subtract PAGE_CACHE_SIZE... */ - pglen += base & ~PAGE_CACHE_MASK; - } - for (;;) { - flush_dcache_page(*ppage); - kunmap(*ppage); - if (pglen <= PAGE_CACHE_SIZE) - break; - pglen -= PAGE_CACHE_SIZE; - ppage++; - } -} - void xdr_partial_copy_from_skb(struct xdr_buf *xdr, unsigned int base, skb_reader_t *desc, @@ -572,7 +445,7 @@ _copy_to_pages(struct page **pages, size_t pgbase, const char *p, size_t len) * Copies data into an arbitrary memory location from an array of pages * The copy is assumed to be non-overlapping. */ -void +static void _copy_from_pages(char *p, struct page **pages, size_t pgbase, size_t len) { struct page **pgfrom; @@ -610,7 +483,7 @@ _copy_from_pages(char *p, struct page **pages, size_t pgbase, size_t len) * 'len' bytes. The extra data is not lost, but is instead * moved into the inlined pages and/or the tail. */ -void +static void xdr_shrink_bufhead(struct xdr_buf *buf, size_t len) { struct kvec *head, *tail; @@ -683,7 +556,7 @@ xdr_shrink_bufhead(struct xdr_buf *buf, size_t len) * 'len' bytes. The extra data is not lost, but is instead * moved into the tail. */ -void +static void xdr_shrink_pagelen(struct xdr_buf *buf, size_t len) { struct kvec *tail; diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index de4bccc1c25d..92ece31702fb 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c @@ -90,6 +90,8 @@ static struct socket *xprt_create_socket(struct rpc_xprt *, int, int); static void xprt_bind_socket(struct rpc_xprt *, struct socket *); static int __xprt_get_cong(struct rpc_xprt *, struct rpc_task *); +static int xprt_clear_backlog(struct rpc_xprt *xprt); + #ifdef RPC_DEBUG_DATA /* * Print the buffer contents (first 128 bytes only--just enough for @@ -1397,7 +1399,7 @@ xprt_release(struct rpc_task *task) /* * Set default timeout parameters */ -void +static void xprt_default_timeout(struct rpc_timeout *to, int proto) { if (proto == IPPROTO_UDP) @@ -1633,7 +1635,7 @@ xprt_create_proto(int proto, struct sockaddr_in *sap, struct rpc_timeout *to) /* * Prepare for transport shutdown. */ -void +static void xprt_shutdown(struct rpc_xprt *xprt) { xprt->shutdown = 1; @@ -1648,7 +1650,7 @@ xprt_shutdown(struct rpc_xprt *xprt) /* * Clear the xprt backlog queue */ -int +static int xprt_clear_backlog(struct rpc_xprt *xprt) { rpc_wake_up_next(&xprt->backlog); wake_up(&xprt->cong_wait); -- cgit v1.2.3 From f740f4c517a3b10ef70f73828f9d20f6627f50fc Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 27 Dec 2004 02:32:23 -0800 Subject: [X25]: Staticize, and remove unused global functions. Signed-off-by: Adrian Bunk Signed-off-by: David S. Miller --- include/net/x25.h | 5 ----- net/x25/af_x25.c | 8 ++++---- net/x25/x25_dev.c | 23 ----------------------- net/x25/x25_link.c | 33 +++++---------------------------- net/x25/x25_proc.c | 4 ++-- 5 files changed, 11 insertions(+), 62 deletions(-) (limited to 'include') diff --git a/include/net/x25.h b/include/net/x25.h index 53a19c468c1b..4d64a0bc2b0d 100644 --- a/include/net/x25.h +++ b/include/net/x25.h @@ -162,7 +162,6 @@ extern int x25_addr_ntoa(unsigned char *, struct x25_address *, struct x25_address *); extern int x25_addr_aton(unsigned char *, struct x25_address *, struct x25_address *); -extern unsigned int x25_new_lci(struct x25_neigh *); extern struct sock *x25_find_socket(unsigned int, struct x25_neigh *); extern void x25_destroy_socket(struct sock *); extern int x25_rx_call_request(struct sk_buff *, struct x25_neigh *, unsigned int); @@ -171,7 +170,6 @@ extern void x25_kill_by_neigh(struct x25_neigh *); /* x25_dev.c */ extern void x25_send_frame(struct sk_buff *, struct x25_neigh *); extern int x25_lapb_receive_frame(struct sk_buff *, struct net_device *, struct packet_type *); -extern int x25_llc_receive_frame(struct sk_buff *, struct net_device *, struct packet_type *); extern void x25_establish_link(struct x25_neigh *); extern void x25_terminate_link(struct x25_neigh *); @@ -191,9 +189,6 @@ extern void x25_link_device_up(struct net_device *); extern void x25_link_device_down(struct net_device *); extern void x25_link_established(struct x25_neigh *); extern void x25_link_terminated(struct x25_neigh *); -extern void x25_transmit_restart_request(struct x25_neigh *); -extern void x25_transmit_restart_confirmation(struct x25_neigh *); -extern void x25_transmit_diagnostic(struct x25_neigh *, unsigned char); extern void x25_transmit_clear_request(struct x25_neigh *, unsigned int, unsigned char); extern void x25_transmit_link(struct sk_buff *, struct x25_neigh *); extern int x25_subscr_ioctl(unsigned int, void __user *); diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index 02d8235d5a55..07171faaad2a 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c @@ -261,7 +261,7 @@ found: /* * Find a connected X.25 socket given my LCI and neighbour. */ -struct sock *__x25_find_socket(unsigned int lci, struct x25_neigh *nb) +static struct sock *__x25_find_socket(unsigned int lci, struct x25_neigh *nb) { struct sock *s; struct hlist_node *node; @@ -289,7 +289,7 @@ struct sock *x25_find_socket(unsigned int lci, struct x25_neigh *nb) /* * Find a unique LCI for a given device. */ -unsigned int x25_new_lci(struct x25_neigh *nb) +static unsigned int x25_new_lci(struct x25_neigh *nb) { unsigned int lci = 1; struct sock *sk; @@ -1336,7 +1336,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) return rc; } -struct net_proto_family x25_family_ops = { +static struct net_proto_family x25_family_ops = { .family = AF_X25, .create = x25_create, .owner = THIS_MODULE, @@ -1371,7 +1371,7 @@ static struct packet_type x25_packet_type = { .func = x25_lapb_receive_frame, }; -struct notifier_block x25_dev_notifier = { +static struct notifier_block x25_dev_notifier = { .notifier_call = x25_device_event, }; diff --git a/net/x25/x25_dev.c b/net/x25/x25_dev.c index 88e704e70043..36fc3bf6d882 100644 --- a/net/x25/x25_dev.c +++ b/net/x25/x25_dev.c @@ -123,29 +123,6 @@ out: return 0; } -int x25_llc_receive_frame(struct sk_buff *skb, struct net_device *dev, - struct packet_type *ptype) -{ - struct x25_neigh *nb; - int rc = 0; - - skb->sk = NULL; - - /* - * Packet received from unrecognised device, throw it away. - */ - nb = x25_get_neigh(dev); - if (!nb) { - printk(KERN_DEBUG "X.25: unknown_neighbour - %s\n", dev->name); - kfree_skb(skb); - } else { - rc = x25_receive_data(skb, nb); - x25_neigh_put(nb); - } - - return rc; -} - void x25_establish_link(struct x25_neigh *nb) { struct sk_buff *skb; diff --git a/net/x25/x25_link.c b/net/x25/x25_link.c index a2b9b71d4659..3ca204cfb26a 100644 --- a/net/x25/x25_link.c +++ b/net/x25/x25_link.c @@ -35,6 +35,9 @@ static rwlock_t x25_neigh_list_lock = RW_LOCK_UNLOCKED; static void x25_t20timer_expiry(unsigned long); +static void x25_transmit_restart_confirmation(struct x25_neigh *nb); +static void x25_transmit_restart_request(struct x25_neigh *nb); + /* * Linux set/reset timer routines */ @@ -106,7 +109,7 @@ void x25_link_control(struct sk_buff *skb, struct x25_neigh *nb, /* * This routine is called when a Restart Request is needed */ -void x25_transmit_restart_request(struct x25_neigh *nb) +static void x25_transmit_restart_request(struct x25_neigh *nb) { unsigned char *dptr; int len = X25_MAX_L2_LEN + X25_STD_MIN_LEN + 2; @@ -133,7 +136,7 @@ void x25_transmit_restart_request(struct x25_neigh *nb) /* * This routine is called when a Restart Confirmation is needed */ -void x25_transmit_restart_confirmation(struct x25_neigh *nb) +static void x25_transmit_restart_confirmation(struct x25_neigh *nb) { unsigned char *dptr; int len = X25_MAX_L2_LEN + X25_STD_MIN_LEN; @@ -155,32 +158,6 @@ void x25_transmit_restart_confirmation(struct x25_neigh *nb) x25_send_frame(skb, nb); } -/* - * This routine is called when a Diagnostic is required. - */ -void x25_transmit_diagnostic(struct x25_neigh *nb, unsigned char diag) -{ - unsigned char *dptr; - int len = X25_MAX_L2_LEN + X25_STD_MIN_LEN + 1; - struct sk_buff *skb = alloc_skb(len, GFP_ATOMIC); - - if (!skb) - return; - - skb_reserve(skb, X25_MAX_L2_LEN); - - dptr = skb_put(skb, X25_STD_MIN_LEN + 1); - - *dptr++ = nb->extended ? X25_GFI_EXTSEQ : X25_GFI_STDSEQ; - *dptr++ = 0x00; - *dptr++ = X25_DIAGNOSTIC; - *dptr++ = diag; - - skb->sk = NULL; - - x25_send_frame(skb, nb); -} - /* * This routine is called when a Clear Request is needed outside of the context * of a connected socket. diff --git a/net/x25/x25_proc.c b/net/x25/x25_proc.c index 64fff05abf8a..37c9447e589b 100644 --- a/net/x25/x25_proc.c +++ b/net/x25/x25_proc.c @@ -166,14 +166,14 @@ out: return 0; } -struct seq_operations x25_seq_route_ops = { +static struct seq_operations x25_seq_route_ops = { .start = x25_seq_route_start, .next = x25_seq_route_next, .stop = x25_seq_route_stop, .show = x25_seq_route_show, }; -struct seq_operations x25_seq_socket_ops = { +static struct seq_operations x25_seq_socket_ops = { .start = x25_seq_socket_start, .next = x25_seq_socket_next, .stop = x25_seq_socket_stop, -- cgit v1.2.3 From eeab3c29feb04e7acc1304af6ae31b07f50d73b4 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 27 Dec 2004 02:33:52 -0800 Subject: [XFRM]: Staticize, and remove unused global functions. Signed-off-by: Adrian Bunk Signed-off-by: David S. Miller --- include/net/xfrm.h | 5 ----- net/xfrm/xfrm_algo.c | 8 -------- net/xfrm/xfrm_export.c | 1 - net/xfrm/xfrm_policy.c | 8 ++++---- net/xfrm/xfrm_state.c | 7 +++++-- net/xfrm/xfrm_user.c | 4 ++-- 6 files changed, 11 insertions(+), 22 deletions(-) (limited to 'include') diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 7078e743b732..37d9d9467a00 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -843,7 +843,6 @@ static inline int xfrm_dst_lookup(struct xfrm_dst **dst, struct flowi *fl, unsig } #endif -void xfrm_policy_init(void); struct xfrm_policy *xfrm_policy_alloc(int gfp); extern int xfrm_policy_walk(int (*func)(struct xfrm_policy *, int, int, void*), void *); int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl); @@ -858,12 +857,9 @@ struct xfrm_state * xfrm_find_acq(u8 mode, u32 reqid, u8 proto, int create, unsigned short family); extern void xfrm_policy_flush(void); extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol); -extern struct xfrm_policy *xfrm_sk_policy_lookup(struct sock *sk, int dir, struct flowi *fl); extern int xfrm_flush_bundles(void); extern wait_queue_head_t km_waitq; -extern void km_state_expired(struct xfrm_state *x, int hard); -extern int km_query(struct xfrm_state *x, struct xfrm_tmpl *, struct xfrm_policy *pol); extern int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, u16 sport); extern void km_policy_expired(struct xfrm_policy *pol, int dir, int hard); @@ -875,7 +871,6 @@ extern int xfrm_count_auth_supported(void); extern int xfrm_count_enc_supported(void); extern struct xfrm_algo_desc *xfrm_aalg_get_byidx(unsigned int idx); extern struct xfrm_algo_desc *xfrm_ealg_get_byidx(unsigned int idx); -extern struct xfrm_algo_desc *xfrm_calg_get_byidx(unsigned int idx); extern struct xfrm_algo_desc *xfrm_aalg_get_byid(int alg_id); extern struct xfrm_algo_desc *xfrm_ealg_get_byid(int alg_id); extern struct xfrm_algo_desc *xfrm_calg_get_byid(int alg_id); diff --git a/net/xfrm/xfrm_algo.c b/net/xfrm/xfrm_algo.c index 0612ecbc2764..8947e63ca788 100644 --- a/net/xfrm/xfrm_algo.c +++ b/net/xfrm/xfrm_algo.c @@ -416,14 +416,6 @@ struct xfrm_algo_desc *xfrm_ealg_get_byidx(unsigned int idx) return &ealg_list[idx]; } -struct xfrm_algo_desc *xfrm_calg_get_byidx(unsigned int idx) -{ - if (idx >= calg_entries()) - return NULL; - - return &calg_list[idx]; -} - /* * Probe for the availability of crypto algorithms, and set the available * flag for any algorithms found on the system. This is typically called by diff --git a/net/xfrm/xfrm_export.c b/net/xfrm/xfrm_export.c index fd34836cdf7f..7ca0e889e54a 100644 --- a/net/xfrm/xfrm_export.c +++ b/net/xfrm/xfrm_export.c @@ -53,7 +53,6 @@ EXPORT_SYMBOL_GPL(xfrm_count_auth_supported); EXPORT_SYMBOL_GPL(xfrm_count_enc_supported); EXPORT_SYMBOL_GPL(xfrm_aalg_get_byidx); EXPORT_SYMBOL_GPL(xfrm_ealg_get_byidx); -EXPORT_SYMBOL_GPL(xfrm_calg_get_byidx); EXPORT_SYMBOL_GPL(xfrm_aalg_get_byid); EXPORT_SYMBOL_GPL(xfrm_ealg_get_byid); EXPORT_SYMBOL_GPL(xfrm_calg_get_byid); diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 70ba1fc61d9f..c6ffe5413ca1 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -33,7 +33,7 @@ struct xfrm_policy *xfrm_policy_list[XFRM_POLICY_MAX*2]; static rwlock_t xfrm_policy_afinfo_lock = RW_LOCK_UNLOCKED; static struct xfrm_policy_afinfo *xfrm_policy_afinfo[NPROTO]; -kmem_cache_t *xfrm_dst_cache; +static kmem_cache_t *xfrm_dst_cache; static struct work_struct xfrm_policy_gc_work; static struct list_head xfrm_policy_gc_list = @@ -498,7 +498,7 @@ static void xfrm_policy_lookup(struct flowi *fl, u16 family, u8 dir, *obj_refp = &pol->refcnt; } -struct xfrm_policy *xfrm_sk_policy_lookup(struct sock *sk, int dir, struct flowi *fl) +static struct xfrm_policy *xfrm_sk_policy_lookup(struct sock *sk, int dir, struct flowi *fl) { struct xfrm_policy *pol; @@ -1222,13 +1222,13 @@ static int xfrm_dev_event(struct notifier_block *this, unsigned long event, void return NOTIFY_DONE; } -struct notifier_block xfrm_dev_notifier = { +static struct notifier_block xfrm_dev_notifier = { xfrm_dev_event, NULL, 0 }; -void __init xfrm_policy_init(void) +static void __init xfrm_policy_init(void) { xfrm_dst_cache = kmem_cache_create("xfrm_dst_cache", sizeof(struct xfrm_dst), diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index a3ef46c5d187..e82cb815c791 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -51,6 +51,9 @@ static void __xfrm_state_delete(struct xfrm_state *x); static struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned short family); static void xfrm_state_put_afinfo(struct xfrm_state_afinfo *afinfo); +static int km_query(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *pol); +static void km_state_expired(struct xfrm_state *x, int hard); + static void xfrm_state_gc_destroy(struct xfrm_state *x) { if (del_timer(&x->timer)) @@ -746,7 +749,7 @@ void xfrm_replay_advance(struct xfrm_state *x, u32 seq) static struct list_head xfrm_km_list = LIST_HEAD_INIT(xfrm_km_list); static rwlock_t xfrm_km_lock = RW_LOCK_UNLOCKED; -void km_state_expired(struct xfrm_state *x, int hard) +static void km_state_expired(struct xfrm_state *x, int hard) { struct xfrm_mgr *km; @@ -764,7 +767,7 @@ void km_state_expired(struct xfrm_state *x, int hard) wake_up(&km_waitq); } -int km_query(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *pol) +static int km_query(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *pol) { int err = -EINVAL; struct xfrm_mgr *km; diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index 502c30d097b9..b1e1b29dc519 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c @@ -1128,8 +1128,8 @@ static int xfrm_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *xt, /* User gives us xfrm_user_policy_info followed by an array of 0 * or more templates. */ -struct xfrm_policy *xfrm_compile_policy(u16 family, int opt, - u8 *data, int len, int *dir) +static struct xfrm_policy *xfrm_compile_policy(u16 family, int opt, + u8 *data, int len, int *dir) { struct xfrm_userpolicy_info *p = (struct xfrm_userpolicy_info *)data; struct xfrm_user_tmpl *ut = (struct xfrm_user_tmpl *) (p + 1); -- cgit v1.2.3 From ee0168926e0492f4d34fcd3b9381753c848bb0de Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 27 Dec 2004 02:36:20 -0800 Subject: [NET]: Mark eth_header_parse static. Signed-off-by: Adrian Bunk Signed-off-by: David S. Miller --- include/linux/etherdevice.h | 2 -- net/ethernet/eth.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'include') diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index 6af5ecf9787a..ca6a19b1479f 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h @@ -37,8 +37,6 @@ extern void eth_header_cache_update(struct hh_cache *hh, struct net_device *dev unsigned char * haddr); extern int eth_header_cache(struct neighbour *neigh, struct hh_cache *hh); -extern int eth_header_parse(struct sk_buff *skb, - unsigned char *haddr); extern struct net_device *alloc_etherdev(int sizeof_priv); static inline void eth_copy_and_sum (struct sk_buff *dest, diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c index 5a3a14a72e6d..16c4234cbe12 100644 --- a/net/ethernet/eth.c +++ b/net/ethernet/eth.c @@ -208,7 +208,7 @@ unsigned short eth_type_trans(struct sk_buff *skb, struct net_device *dev) return htons(ETH_P_802_2); } -int eth_header_parse(struct sk_buff *skb, unsigned char *haddr) +static int eth_header_parse(struct sk_buff *skb, unsigned char *haddr) { struct ethhdr *eth = eth_hdr(skb); memcpy(haddr, eth->h_source, ETH_ALEN); -- cgit v1.2.3 From ebb461f7cfaa538f0bac28428d731657c2e2c174 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 27 Dec 2004 02:40:25 -0800 Subject: [NETLINK]: Staticize and remove unused functions. Signed-off-by: Adrian Bunk Signed-off-by: David S. Miller --- include/linux/netlink.h | 3 --- net/netlink/af_netlink.c | 28 +--------------------------- 2 files changed, 1 insertion(+), 30 deletions(-) (limited to 'include') diff --git a/include/linux/netlink.h b/include/linux/netlink.h index e969de36edaa..ee36f08c341e 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h @@ -116,8 +116,6 @@ struct netlink_skb_parms #define NETLINK_CREDS(skb) (&NETLINK_CB((skb)).creds) -extern int netlink_attach(int unit, int (*function)(int,struct sk_buff *skb)); -extern void netlink_detach(int unit); extern int netlink_post(int unit, struct sk_buff *skb); extern struct sock *netlink_kernel_create(int unit, void (*input)(struct sock *sk, int len)); extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); @@ -129,7 +127,6 @@ extern int netlink_register_notifier(struct notifier_block *nb); extern int netlink_unregister_notifier(struct notifier_block *nb); /* finegrained unicast helpers: */ -struct sock *netlink_getsockbypid(struct sock *ssk, u32 pid); struct sock *netlink_getsockbyfilp(struct file *filp); int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, long timeo); void netlink_detachskb(struct sock *sk, struct sk_buff *skb); diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 360913944ae0..755a3b10f9e1 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -546,7 +546,7 @@ static void netlink_overrun(struct sock *sk) } } -struct sock *netlink_getsockbypid(struct sock *ssk, u32 pid) +static struct sock *netlink_getsockbypid(struct sock *ssk, u32 pid) { int protocol = ssk->sk_protocol; struct sock *sock; @@ -1210,30 +1210,6 @@ static rwlock_t nl_emu_lock = RW_LOCK_UNLOCKED; * Backward compatibility. */ -int netlink_attach(int unit, int (*function)(int, struct sk_buff *skb)) -{ - struct sock *sk = netlink_kernel_create(unit, NULL); - if (sk == NULL) - return -ENOBUFS; - nlk_sk(sk)->handler = function; - write_lock_bh(&nl_emu_lock); - netlink_kernel[unit] = sk->sk_socket; - write_unlock_bh(&nl_emu_lock); - return 0; -} - -void netlink_detach(int unit) -{ - struct socket *sock; - - write_lock_bh(&nl_emu_lock); - sock = netlink_kernel[unit]; - netlink_kernel[unit] = NULL; - write_unlock_bh(&nl_emu_lock); - - sock_release(sock); -} - int netlink_post(int unit, struct sk_buff *skb) { struct socket *sock; @@ -1522,7 +1498,5 @@ EXPORT_SYMBOL(netlink_unicast); EXPORT_SYMBOL(netlink_unregister_notifier); #if defined(CONFIG_NETLINK_DEV) || defined(CONFIG_NETLINK_DEV_MODULE) -EXPORT_SYMBOL(netlink_attach); -EXPORT_SYMBOL(netlink_detach); EXPORT_SYMBOL(netlink_post); #endif -- cgit v1.2.3 From cc8eaf15d3d413135d8b9c986f13696e9e6dd21e Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 27 Dec 2004 02:54:21 -0800 Subject: [IPX]: Make needlessly global code static. Signed-off-by: Adrian Bunk Signed-off-by: David S. Miller --- include/net/ipx.h | 8 -------- net/ipx/af_ipx.c | 10 ++++++++-- net/ipx/ipx_proc.c | 6 +++--- 3 files changed, 11 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/include/net/ipx.h b/include/net/ipx.h index 064e5f7a4154..006a31bfa2d1 100644 --- a/include/net/ipx.h +++ b/include/net/ipx.h @@ -139,14 +139,6 @@ static __inline__ void ipxitf_put(struct ipx_interface *intrfc) ipxitf_down(intrfc); } -extern void __ipxitf_down(struct ipx_interface *intrfc); - -static __inline__ void __ipxitf_put(struct ipx_interface *intrfc) -{ - if (atomic_dec_and_test(&intrfc->refcnt)) - __ipxitf_down(intrfc); -} - static __inline__ void ipxrtr_hold(struct ipx_route *rt) { atomic_inc(&rt->refcnt); diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c index e88d37fe262c..6da62172f674 100644 --- a/net/ipx/af_ipx.c +++ b/net/ipx/af_ipx.c @@ -291,7 +291,7 @@ found: } #endif -void __ipxitf_down(struct ipx_interface *intrfc) +static void __ipxitf_down(struct ipx_interface *intrfc) { struct sock *s; struct hlist_node *node, *t; @@ -335,6 +335,12 @@ void ipxitf_down(struct ipx_interface *intrfc) spin_unlock_bh(&ipx_interfaces_lock); } +static __inline__ void __ipxitf_put(struct ipx_interface *intrfc) +{ + if (atomic_dec_and_test(&intrfc->refcnt)) + __ipxitf_down(intrfc); +} + static int ipxitf_device_event(struct notifier_block *notifier, unsigned long event, void *ptr) { @@ -1629,7 +1635,7 @@ out: return rc; } -int ipx_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt) +static int ipx_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt) { /* NULL here for pt means the packet was looped back */ struct ipx_interface *intrfc; diff --git a/net/ipx/ipx_proc.c b/net/ipx/ipx_proc.c index c2febe44d1f2..6b3cb469fc96 100644 --- a/net/ipx/ipx_proc.c +++ b/net/ipx/ipx_proc.c @@ -287,21 +287,21 @@ out: return 0; } -struct seq_operations ipx_seq_interface_ops = { +static struct seq_operations ipx_seq_interface_ops = { .start = ipx_seq_interface_start, .next = ipx_seq_interface_next, .stop = ipx_seq_interface_stop, .show = ipx_seq_interface_show, }; -struct seq_operations ipx_seq_route_ops = { +static struct seq_operations ipx_seq_route_ops = { .start = ipx_seq_route_start, .next = ipx_seq_route_next, .stop = ipx_seq_route_stop, .show = ipx_seq_route_show, }; -struct seq_operations ipx_seq_socket_ops = { +static struct seq_operations ipx_seq_socket_ops = { .start = ipx_seq_socket_start, .next = ipx_seq_socket_next, .stop = ipx_seq_interface_stop, -- cgit v1.2.3 From 4d0262fa65f644bb23f0de6db84ab7ac0aa128c2 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 27 Dec 2004 03:50:18 -0800 Subject: [IPV4]: Staticize and remove unneeded exports. The patch below contains the following possible cleanups: - make some needlessly global code static - remove the following unused global functions: - fib_rules.c: fib_rules_map_destination - xfrm4_policy.: xfrm4_fini - remove the following unneeded EXPORT_SYMBOL: - tcp_timer.c: tcp_timer_bug_msg Signed-off-by: Adrian Bunk Signed-off-by: David S. Miller --- include/net/ip.h | 2 -- include/net/ip_fib.h | 2 -- include/net/ipconfig.h | 11 ----------- include/net/tcp.h | 16 ---------------- include/net/xfrm.h | 1 - net/ipv4/af_inet.c | 8 ++++---- net/ipv4/arp.c | 8 ++++---- net/ipv4/devinet.c | 4 ++-- net/ipv4/fib_frontend.c | 6 +++--- net/ipv4/fib_rules.c | 8 +------- net/ipv4/icmp.c | 4 ++-- net/ipv4/igmp.c | 16 ++++++++-------- net/ipv4/ip_gre.c | 6 +++--- net/ipv4/ip_sockglue.c | 2 +- net/ipv4/ipconfig.c | 12 ++++++------ net/ipv4/raw.c | 4 ++-- net/ipv4/route.c | 32 ++++++++++++++++---------------- net/ipv4/tcp_input.c | 16 ++++++++++++++-- net/ipv4/tcp_minisocks.c | 4 +++- net/ipv4/tcp_timer.c | 3 --- net/ipv4/udp.c | 13 ++++++++----- net/ipv4/xfrm4_policy.c | 7 ------- 22 files changed, 77 insertions(+), 108 deletions(-) (limited to 'include') diff --git a/include/net/ip.h b/include/net/ip.h index 15a1c6a2e534..02d783315f2e 100644 --- a/include/net/ip.h +++ b/include/net/ip.h @@ -295,8 +295,6 @@ extern void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err, extern void ip_local_error(struct sock *sk, int err, u32 daddr, u16 dport, u32 info); -extern int ipv4_proc_init(void); - /* sysctl helpers - any sysctl which holds a value that ends up being * fed into the routing cache should use these handlers. */ diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index 48a6ea4c2565..9f28dfffb6c6 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h @@ -200,7 +200,6 @@ extern void fib_select_default(const struct flowi *flp, struct fib_result *res); /* Exported by fib_frontend.c */ extern void ip_fib_init(void); -extern void fib_flush(void); extern int inet_rtm_delroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg); extern int inet_rtm_newroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg); extern int inet_rtm_getroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg); @@ -226,7 +225,6 @@ extern struct fib_table *fib_hash_init(int id); extern int inet_rtm_delrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg); extern int inet_rtm_newrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg); extern int inet_dump_rules(struct sk_buff *skb, struct netlink_callback *cb); -extern u32 fib_rules_map_destination(u32 daddr, struct fib_result *res); #ifdef CONFIG_NET_CLS_ROUTE extern u32 fib_rules_tclass(struct fib_result *res); #endif diff --git a/include/net/ipconfig.h b/include/net/ipconfig.h index faa9cef707c3..2a1fe996fbc6 100644 --- a/include/net/ipconfig.h +++ b/include/net/ipconfig.h @@ -8,14 +8,10 @@ /* The following are initdata: */ -extern int ic_enable; /* Enable or disable the whole shebang */ - extern int ic_proto_enabled; /* Protocols enabled (see IC_xxx) */ -extern int ic_host_name_set; /* Host name set by ipconfig? */ extern int ic_set_manually; /* IPconfig parameters set manually */ extern u32 ic_myaddr; /* My IP address */ -extern u32 ic_netmask; /* Netmask for local subnet */ extern u32 ic_gateway; /* Gateway IP address */ extern u32 ic_servaddr; /* Boot server IP address */ @@ -24,13 +20,6 @@ extern u32 root_server_addr; /* Address of NFS server */ extern u8 root_server_path[]; /* Path to mount as root */ - -/* The following are persistent (not initdata): */ - -extern int ic_proto_used; /* Protocol used, if any */ -extern u32 ic_nameserver; /* DNS server IP address */ -extern u8 ic_domain[]; /* DNS (not NIS) domain name */ - /* bits in ic_proto_{enabled,used} */ #define IC_PROTO 0xFF /* Protocols mask: */ #define IC_BOOTP 0x01 /* BOOTP (or DHCP, see below) */ diff --git a/include/net/tcp.h b/include/net/tcp.h index f5bac4c9b704..c39b09da5015 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -315,7 +315,6 @@ static inline void tcp_tw_put(struct tcp_tw_bucket *tw) extern atomic_t tcp_orphan_count; extern int tcp_tw_count; extern void tcp_time_wait(struct sock *sk, int state, int timeo); -extern void tcp_tw_schedule(struct tcp_tw_bucket *tw, int timeo); extern void tcp_tw_deschedule(struct tcp_tw_bucket *tw); @@ -2020,21 +2019,6 @@ static inline void tcp_westwood_update_rtt(struct tcp_opt *tp, __u32 rtt_seq) tp->westwood.rtt = rtt_seq; } -void __tcp_westwood_fast_bw(struct sock *, struct sk_buff *); -void __tcp_westwood_slow_bw(struct sock *, struct sk_buff *); - -static inline void tcp_westwood_fast_bw(struct sock *sk, struct sk_buff *skb) -{ - if (tcp_is_westwood(tcp_sk(sk))) - __tcp_westwood_fast_bw(sk, skb); -} - -static inline void tcp_westwood_slow_bw(struct sock *sk, struct sk_buff *skb) -{ - if (tcp_is_westwood(tcp_sk(sk))) - __tcp_westwood_slow_bw(sk, skb); -} - static inline __u32 __tcp_westwood_bw_rttmin(const struct tcp_opt *tp) { return max((tp->westwood.bw_est) * (tp->westwood.rtt_min) / diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 37d9d9467a00..d29831f449c1 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -782,7 +782,6 @@ struct xfrm6_tunnel { extern void xfrm_init(void); extern void xfrm4_init(void); -extern void xfrm4_fini(void); extern void xfrm6_init(void); extern void xfrm6_fini(void); extern void xfrm_state_init(void); diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 56872058ebce..19c9c4626875 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -659,7 +659,7 @@ int inet_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, } -ssize_t inet_sendpage(struct socket *sock, struct page *page, int offset, size_t size, int flags) +static ssize_t inet_sendpage(struct socket *sock, struct page *page, int offset, size_t size, int flags) { struct sock *sk = sock->sk; @@ -1011,7 +1011,7 @@ static int __init init_ipv4_mibs(void) return 0; } -int ipv4_proc_init(void); +static int ipv4_proc_init(void); extern void ipfrag_init(void); static int __init inet_init(void) @@ -1136,7 +1136,7 @@ extern void tcp4_proc_exit(void); extern int udp4_proc_init(void); extern void udp4_proc_exit(void); -int __init ipv4_proc_init(void) +static int __init ipv4_proc_init(void) { int rc = 0; @@ -1166,7 +1166,7 @@ out_raw: } #else /* CONFIG_PROC_FS */ -int __init ipv4_proc_init(void) +static int __init ipv4_proc_init(void) { return 0; } diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 9b5d1e813652..317d69336c64 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c @@ -704,7 +704,7 @@ static void parp_redo(struct sk_buff *skb) * Process an arp request. */ -int arp_process(struct sk_buff *skb) +static int arp_process(struct sk_buff *skb) { struct net_device *dev = skb->dev; struct in_device *in_dev = in_dev_get(dev); @@ -961,7 +961,7 @@ out_of_mem: * Set (create) an ARP cache entry. */ -int arp_req_set(struct arpreq *r, struct net_device * dev) +static int arp_req_set(struct arpreq *r, struct net_device * dev) { u32 ip = ((struct sockaddr_in *) &r->arp_pa)->sin_addr.s_addr; struct neighbour *neigh; @@ -1075,7 +1075,7 @@ static int arp_req_get(struct arpreq *r, struct net_device *dev) return err; } -int arp_req_delete(struct arpreq *r, struct net_device * dev) +static int arp_req_delete(struct arpreq *r, struct net_device * dev) { int err; u32 ip = ((struct sockaddr_in *)&r->arp_pa)->sin_addr.s_addr; @@ -1207,7 +1207,7 @@ static int arp_netdev_event(struct notifier_block *this, unsigned long event, vo return NOTIFY_DONE; } -struct notifier_block arp_netdev_notifier = { +static struct notifier_block arp_netdev_notifier = { .notifier_call = arp_netdev_event, }; diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index cb697aba93a2..7b6054d49271 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -380,7 +380,7 @@ struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, u32 prefix, return NULL; } -int inet_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) +static int inet_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) { struct rtattr **rta = arg; struct in_device *in_dev; @@ -412,7 +412,7 @@ out: return -EADDRNOTAVAIL; } -int inet_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) +static int inet_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) { struct rtattr **rta = arg; struct net_device *dev; diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 4ccd02f535f7..563e7d612706 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c @@ -75,7 +75,7 @@ struct fib_table *__fib_new_table(int id) #endif /* CONFIG_IP_MULTIPLE_TABLES */ -void fib_flush(void) +static void fib_flush(void) { int flushed = 0; #ifdef CONFIG_IP_MULTIPLE_TABLES @@ -585,11 +585,11 @@ static int fib_netdev_event(struct notifier_block *this, unsigned long event, vo return NOTIFY_DONE; } -struct notifier_block fib_inetaddr_notifier = { +static struct notifier_block fib_inetaddr_notifier = { .notifier_call =fib_inetaddr_event, }; -struct notifier_block fib_netdev_notifier = { +static struct notifier_block fib_netdev_notifier = { .notifier_call =fib_netdev_event, }; diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c index e4b3af075657..f6675eef21cf 100644 --- a/net/ipv4/fib_rules.c +++ b/net/ipv4/fib_rules.c @@ -245,12 +245,6 @@ int inet_rtm_newrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) return 0; } -u32 fib_rules_map_destination(u32 daddr, struct fib_result *res) -{ - u32 mask = inet_make_mask(res->prefixlen); - return (daddr&~mask)|res->fi->fib_nh->nh_gw; -} - #ifdef CONFIG_NET_CLS_ROUTE u32 fib_rules_tclass(struct fib_result *res) { @@ -368,7 +362,7 @@ static int fib_rules_event(struct notifier_block *this, unsigned long event, voi } -struct notifier_block fib_rules_notifier = { +static struct notifier_block fib_rules_notifier = { .notifier_call =fib_rules_event, }; diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index 74089ab9f74e..0be6e865c068 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c @@ -327,8 +327,8 @@ static void icmp_out_count(int type) * Checksum each fragment, and on the first include the headers and final * checksum. */ -int icmp_glue_bits(void *from, char *to, int offset, int len, int odd, - struct sk_buff *skb) +static int icmp_glue_bits(void *from, char *to, int offset, int len, int odd, + struct sk_buff *skb) { struct icmp_bxm *icmp_param = (struct icmp_bxm *)from; unsigned int csum; diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index fc0c27f25f6a..aa7e95a9c489 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c @@ -143,8 +143,8 @@ static int sf_setstate(struct ip_mc_list *pmc); static void sf_markstate(struct ip_mc_list *pmc); #endif static void ip_mc_clear_src(struct ip_mc_list *pmc); -int ip_mc_add_src(struct in_device *in_dev, __u32 *pmca, int sfmode, - int sfcount, __u32 *psfsrc, int delta); +static int ip_mc_add_src(struct in_device *in_dev, __u32 *pmca, int sfmode, + int sfcount, __u32 *psfsrc, int delta); static void ip_ma_put(struct ip_mc_list *im) { @@ -1384,8 +1384,8 @@ static int ip_mc_del1_src(struct ip_mc_list *pmc, int sfmode, #define igmp_ifc_event(x) do { } while (0) #endif -int ip_mc_del_src(struct in_device *in_dev, __u32 *pmca, int sfmode, - int sfcount, __u32 *psfsrc, int delta) +static int ip_mc_del_src(struct in_device *in_dev, __u32 *pmca, int sfmode, + int sfcount, __u32 *psfsrc, int delta) { struct ip_mc_list *pmc; int changerec = 0; @@ -1520,8 +1520,8 @@ static int sf_setstate(struct ip_mc_list *pmc) /* * Add multicast source filter list to the interface list */ -int ip_mc_add_src(struct in_device *in_dev, __u32 *pmca, int sfmode, - int sfcount, __u32 *psfsrc, int delta) +static int ip_mc_add_src(struct in_device *in_dev, __u32 *pmca, int sfmode, + int sfcount, __u32 *psfsrc, int delta) { struct ip_mc_list *pmc; int isexclude; @@ -1667,8 +1667,8 @@ done: return err; } -int ip_mc_leave_src(struct sock *sk, struct ip_mc_socklist *iml, - struct in_device *in_dev) +static int ip_mc_leave_src(struct sock *sk, struct ip_mc_socklist *iml, + struct in_device *in_dev) { int err; diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 2c768ecc0a84..ce1e88c4c248 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -304,7 +304,7 @@ static void ipgre_tunnel_uninit(struct net_device *dev) } -void ipgre_err(struct sk_buff *skb, u32 info) +static void ipgre_err(struct sk_buff *skb, u32 info) { #ifndef I_WISH_WORLD_WERE_PERFECT @@ -552,7 +552,7 @@ ipgre_ecn_encapsulate(u8 tos, struct iphdr *old_iph, struct sk_buff *skb) return INET_ECN_encapsulate(tos, inner); } -int ipgre_rcv(struct sk_buff *skb) +static int ipgre_rcv(struct sk_buff *skb) { struct iphdr *iph; u8 *h; @@ -1279,7 +1279,7 @@ err1: goto out; } -void ipgre_fini(void) +static void ipgre_fini(void) { if (inet_del_protocol(&ipgre_protocol, IPPROTO_GRE) < 0) printk(KERN_INFO "ipgre close: can't remove protocol\n"); diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index d352252326c1..f1a3631aed81 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c @@ -92,7 +92,7 @@ static void ip_cmsg_recv_opts(struct msghdr *msg, struct sk_buff *skb) } -void ip_cmsg_recv_retopts(struct msghdr *msg, struct sk_buff *skb) +static void ip_cmsg_recv_retopts(struct msghdr *msg, struct sk_buff *skb) { unsigned char optbuf[sizeof(struct ip_options) + 40]; struct ip_options * opt = (struct ip_options*)optbuf; diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index f1c60e44a8da..86ade3d3e970 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c @@ -109,7 +109,7 @@ */ int ic_set_manually __initdata = 0; /* IPconfig parameters set manually */ -int ic_enable __initdata = 0; /* IP config enabled? */ +static int ic_enable __initdata = 0; /* IP config enabled? */ /* Protocol choice */ int ic_proto_enabled __initdata = 0 @@ -124,10 +124,10 @@ int ic_proto_enabled __initdata = 0 #endif ; -int ic_host_name_set __initdata = 0; /* Host name set by us? */ +static int ic_host_name_set __initdata = 0; /* Host name set by us? */ u32 ic_myaddr = INADDR_NONE; /* My IP address */ -u32 ic_netmask = INADDR_NONE; /* Netmask for local subnet */ +static u32 ic_netmask = INADDR_NONE; /* Netmask for local subnet */ u32 ic_gateway = INADDR_NONE; /* Gateway IP address */ u32 ic_servaddr = INADDR_NONE; /* Boot server IP address */ @@ -137,9 +137,9 @@ u8 root_server_path[256] = { 0, }; /* Path to mount as root */ /* Persistent data: */ -int ic_proto_used; /* Protocol used, if any */ -u32 ic_nameservers[CONF_NAMESERVERS_MAX]; /* DNS Server IP addresses */ -u8 ic_domain[64]; /* DNS (not NIS) domain name */ +static int ic_proto_used; /* Protocol used, if any */ +static u32 ic_nameservers[CONF_NAMESERVERS_MAX]; /* DNS Server IP addresses */ +static u8 ic_domain[64]; /* DNS (not NIS) domain name */ /* * Private state. diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index 2c6dd971b10a..58de4dbaf168 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c @@ -562,8 +562,8 @@ out: return ret; * we return it, otherwise we block. */ -int raw_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, - size_t len, int noblock, int flags, int *addr_len) +static int raw_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, + size_t len, int noblock, int flags, int *addr_len) { struct inet_opt *inet = inet_sk(sk); size_t copied = 0; diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 4de83141d5bc..9c438efe1249 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -108,22 +108,22 @@ #define RT_GC_TIMEOUT (300*HZ) -int ip_rt_min_delay = 2 * HZ; -int ip_rt_max_delay = 10 * HZ; -int ip_rt_max_size; -int ip_rt_gc_timeout = RT_GC_TIMEOUT; -int ip_rt_gc_interval = 60 * HZ; -int ip_rt_gc_min_interval = HZ / 2; -int ip_rt_redirect_number = 9; -int ip_rt_redirect_load = HZ / 50; -int ip_rt_redirect_silence = ((HZ / 50) << (9 + 1)); -int ip_rt_error_cost = HZ; -int ip_rt_error_burst = 5 * HZ; -int ip_rt_gc_elasticity = 8; -int ip_rt_mtu_expires = 10 * 60 * HZ; -int ip_rt_min_pmtu = 512 + 20 + 20; -int ip_rt_min_advmss = 256; -int ip_rt_secret_interval = 10 * 60 * HZ; +static int ip_rt_min_delay = 2 * HZ; +static int ip_rt_max_delay = 10 * HZ; +static int ip_rt_max_size; +static int ip_rt_gc_timeout = RT_GC_TIMEOUT; +static int ip_rt_gc_interval = 60 * HZ; +static int ip_rt_gc_min_interval = HZ / 2; +static int ip_rt_redirect_number = 9; +static int ip_rt_redirect_load = HZ / 50; +static int ip_rt_redirect_silence = ((HZ / 50) << (9 + 1)); +static int ip_rt_error_cost = HZ; +static int ip_rt_error_burst = 5 * HZ; +static int ip_rt_gc_elasticity = 8; +static int ip_rt_mtu_expires = 10 * 60 * HZ; +static int ip_rt_min_pmtu = 512 + 20 + 20; +static int ip_rt_min_advmss = 256; +static int ip_rt_secret_interval = 10 * 60 * HZ; static unsigned long rt_deadline; #define RTprint(a...) printk(KERN_DEBUG a) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index a0f598569886..6c876d733426 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -2786,7 +2786,7 @@ static void westwood_update_window(struct sock *sk, __u32 now) * straight forward and doesn't need any particular care. */ -void __tcp_westwood_fast_bw(struct sock *sk, struct sk_buff *skb) +static void __tcp_westwood_fast_bw(struct sock *sk, struct sk_buff *skb) { struct tcp_opt *tp = tcp_sk(sk); @@ -2797,6 +2797,12 @@ void __tcp_westwood_fast_bw(struct sock *sk, struct sk_buff *skb) tp->westwood.rtt_min = westwood_update_rttmin(sk); } +static inline void tcp_westwood_fast_bw(struct sock *sk, struct sk_buff *skb) +{ + if (tcp_is_westwood(tcp_sk(sk))) + __tcp_westwood_fast_bw(sk, skb); +} + /* * @westwood_dupack_update @@ -2867,7 +2873,7 @@ static inline __u32 westwood_acked_count(struct sock *sk) * dupack. But we need to be careful in such case. */ -void __tcp_westwood_slow_bw(struct sock *sk, struct sk_buff *skb) +static void __tcp_westwood_slow_bw(struct sock *sk, struct sk_buff *skb) { struct tcp_opt *tp = tcp_sk(sk); @@ -2877,6 +2883,12 @@ void __tcp_westwood_slow_bw(struct sock *sk, struct sk_buff *skb) tp->westwood.rtt_min = westwood_update_rttmin(sk); } +static inline void tcp_westwood_slow_bw(struct sock *sk, struct sk_buff *skb) +{ + if (tcp_is_westwood(tcp_sk(sk))) + __tcp_westwood_slow_bw(sk, skb); +} + /* This routine deals with incoming acks, but not outgoing ones. */ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag) { diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index d5b6ea321305..b00c6c8b194e 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c @@ -41,6 +41,8 @@ int sysctl_tcp_max_tw_buckets = NR_FILE*2; int sysctl_tcp_syncookies = SYNC_INIT; int sysctl_tcp_abort_on_overflow; +static void tcp_tw_schedule(struct tcp_tw_bucket *tw, int timeo); + static __inline__ int tcp_in_window(u32 seq, u32 end_seq, u32 s_win, u32 e_win) { if (seq == s_win) @@ -551,7 +553,7 @@ static struct timer_list tcp_twcal_timer = TIMER_INITIALIZER(tcp_twcal_tick, 0, 0); static struct hlist_head tcp_twcal_row[TCP_TW_RECYCLE_SLOTS]; -void tcp_tw_schedule(struct tcp_tw_bucket *tw, int timeo) +static void tcp_tw_schedule(struct tcp_tw_bucket *tw, int timeo) { struct hlist_head *list; int slot; diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index 3b4d82176a84..686b56f91322 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c @@ -653,6 +653,3 @@ EXPORT_SYMBOL(tcp_clear_xmit_timers); EXPORT_SYMBOL(tcp_delete_keepalive_timer); EXPORT_SYMBOL(tcp_init_xmit_timers); EXPORT_SYMBOL(tcp_reset_keepalive_timer); -#ifdef TCP_DEBUG -EXPORT_SYMBOL(tcp_timer_bug_msg); -#endif diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 4a1bfb39c4b0..9ae2faae9982 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -219,7 +219,8 @@ static void udp_v4_unhash(struct sock *sk) /* UDP is nearly always wildcards out the wazoo, it makes no sense to try * harder than this. -DaveM */ -struct sock *udp_v4_lookup_longway(u32 saddr, u16 sport, u32 daddr, u16 dport, int dif) +static struct sock *udp_v4_lookup_longway(u32 saddr, u16 sport, + u32 daddr, u16 dport, int dif) { struct sock *sk, *result = NULL; struct hlist_node *node; @@ -263,7 +264,8 @@ struct sock *udp_v4_lookup_longway(u32 saddr, u16 sport, u32 daddr, u16 dport, i return result; } -__inline__ struct sock *udp_v4_lookup(u32 saddr, u16 sport, u32 daddr, u16 dport, int dif) +static __inline__ struct sock *udp_v4_lookup(u32 saddr, u16 sport, + u32 daddr, u16 dport, int dif) { struct sock *sk; @@ -667,7 +669,8 @@ do_confirm: goto out; } -int udp_sendpage(struct sock *sk, struct page *page, int offset, size_t size, int flags) +static int udp_sendpage(struct sock *sk, struct page *page, int offset, + size_t size, int flags) { struct udp_opt *up = udp_sk(sk); int ret; @@ -770,8 +773,8 @@ static __inline__ int udp_checksum_complete(struct sk_buff *skb) * return it, otherwise we block. */ -int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, - size_t len, int noblock, int flags, int *addr_len) +static int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, + size_t len, int noblock, int flags, int *addr_len) { struct inet_opt *inet = inet_sk(sk); struct sockaddr_in *sin = (struct sockaddr_in *)msg->msg_name; diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c index 3ce69883bcc4..012ef304ce63 100644 --- a/net/ipv4/xfrm4_policy.c +++ b/net/ipv4/xfrm4_policy.c @@ -279,10 +279,3 @@ void __init xfrm4_init(void) xfrm4_policy_init(); } -void __exit xfrm4_fini(void) -{ - //xfrm4_input_fini(); - xfrm4_policy_fini(); - xfrm4_state_fini(); -} - -- cgit v1.2.3 From 7a5e9f675d89a1d4a8c539e9bbef2010ad4aa64b Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 27 Dec 2004 04:45:07 -0800 Subject: [IRDA]: Staticize and remove unnecessary exports. The patch below contains the following possible cleanups: - make some needlessly global code static - remove the following unused global functions: - discovery.c: irlmp_find_device - ircomm/ircomm_param.c: ircomm_param_flush - irda_device.c: irda_device_set_dtr_rts - irda_device.c: irda_device_change_speed - irda_device.c: irda_device_set_mode - iriap.c: iriap_getinfobasedetails_request - iriap.c: iriap_getinfobasedetails_confirm - iriap.c: iriap_getobjects_request - iriap.c: iriap_getobjects_confirm - iriap.c: iriap_getvalue - irlan_client.c: irlan_client_reconnect_data_channel - irlap_frame.c: irlap_send_frmr_frame - irlmp.c: irlmp_status_request - remove the follwong unused global variables: - irnet/irnet_ppp.c: irnet_ppp_ops - irsysctl.c: sysctl_compression - qos.c: #ifndef CONFIG_IRDA_DYNAMIC_WINDOW irlap_requested_line_capacity Signed-off-by: Adrian Bunk Signed-off-by: David S. Miller --- include/net/irda/ircomm_event.h | 1 - include/net/irda/ircomm_lmp.h | 27 -------- include/net/irda/ircomm_param.h | 1 - include/net/irda/ircomm_ttp.h | 31 --------- include/net/irda/ircomm_tty.h | 2 - include/net/irda/ircomm_tty_attach.h | 1 - include/net/irda/irda_device.h | 2 - include/net/irda/iriap.h | 10 --- include/net/irda/irlan_client.h | 3 - include/net/irda/irlan_common.h | 3 - include/net/irda/irlap.h | 2 - include/net/irda/irlap_frame.h | 1 - include/net/irda/irlmp.h | 3 - include/net/irda/irttp.h | 3 - include/net/irda/parameters.h | 2 - include/net/irda/qos.h | 1 - net/irda/af_irda.c | 4 +- net/irda/discovery.c | 35 ---------- net/irda/ircomm/ircomm_core.c | 4 +- net/irda/ircomm/ircomm_event.c | 2 +- net/irda/ircomm/ircomm_lmp.c | 128 ++++++++++++++++++----------------- net/irda/ircomm/ircomm_param.c | 17 ----- net/irda/ircomm/ircomm_tty.c | 7 +- net/irda/ircomm/ircomm_tty_attach.c | 12 ++-- net/irda/ircomm/ircomm_tty_ioctl.c | 2 +- net/irda/irda_device.c | 70 +------------------ net/irda/iriap.c | 51 ++++++-------- net/irda/irias_object.c | 6 +- net/irda/irlan/irlan_client.c | 41 +---------- net/irda/irlan/irlan_common.c | 32 +++++---- net/irda/irlan/irlan_provider.c | 6 +- net/irda/irlap.c | 8 ++- net/irda/irlap_event.c | 2 +- net/irda/irlap_frame.c | 35 ++-------- net/irda/irlmp.c | 12 ++-- net/irda/irmod.c | 4 +- net/irda/irnet/irnet.h | 2 - net/irda/irnet/irnet_ppp.c | 8 ++- net/irda/irnet/irnet_ppp.h | 7 -- net/irda/irsysctl.c | 1 - net/irda/irttp.c | 12 ++-- net/irda/parameters.c | 11 +-- net/irda/qos.c | 25 ++++--- 43 files changed, 186 insertions(+), 451 deletions(-) (limited to 'include') diff --git a/include/net/irda/ircomm_event.h b/include/net/irda/ircomm_event.h index 9f0ca85aaabf..c290447872d1 100644 --- a/include/net/irda/ircomm_event.h +++ b/include/net/irda/ircomm_event.h @@ -75,7 +75,6 @@ struct ircomm_info { }; extern char *ircomm_state[]; -extern char *ircomm_event[]; struct ircomm_cb; /* Forward decl. */ diff --git a/include/net/irda/ircomm_lmp.h b/include/net/irda/ircomm_lmp.h index fd738be7c792..ae02106be590 100644 --- a/include/net/irda/ircomm_lmp.h +++ b/include/net/irda/ircomm_lmp.h @@ -32,34 +32,7 @@ #define IRCOMM_LMP_H #include -#include int ircomm_open_lsap(struct ircomm_cb *self); -int ircomm_lmp_connect_request(struct ircomm_cb *self, - struct sk_buff *userdata, - struct ircomm_info *info); -int ircomm_lmp_connect_response(struct ircomm_cb *self, struct sk_buff *skb); -int ircomm_lmp_disconnect_request(struct ircomm_cb *self, - struct sk_buff *userdata, - struct ircomm_info *info); -int ircomm_lmp_data_request(struct ircomm_cb *self, struct sk_buff *skb, - int clen); -int ircomm_lmp_control_request(struct ircomm_cb *self, - struct sk_buff *userdata); -int ircomm_lmp_data_indication(void *instance, void *sap, - struct sk_buff *skb); -void ircomm_lmp_connect_confirm(void *instance, void *sap, - struct qos_info *qos, - __u32 max_sdu_size, - __u8 max_header_size, - struct sk_buff *skb); -void ircomm_lmp_connect_indication(void *instance, void *sap, - struct qos_info *qos, - __u32 max_sdu_size, - __u8 max_header_size, - struct sk_buff *skb); -void ircomm_lmp_disconnect_indication(void *instance, void *sap, - LM_REASON reason, - struct sk_buff *skb); #endif diff --git a/include/net/irda/ircomm_param.h b/include/net/irda/ircomm_param.h index 5f46fb2581e4..e6678800c41f 100644 --- a/include/net/irda/ircomm_param.h +++ b/include/net/irda/ircomm_param.h @@ -141,7 +141,6 @@ struct ircomm_params { struct ircomm_tty_cb; /* Forward decl. */ -int ircomm_param_flush(struct ircomm_tty_cb *self); int ircomm_param_request(struct ircomm_tty_cb *self, __u8 pi, int flush); extern pi_param_info_t ircomm_param_info; diff --git a/include/net/irda/ircomm_ttp.h b/include/net/irda/ircomm_ttp.h index 014d7f56eb04..403081ed725c 100644 --- a/include/net/irda/ircomm_ttp.h +++ b/include/net/irda/ircomm_ttp.h @@ -32,39 +32,8 @@ #define IRCOMM_TTP_H #include -#include int ircomm_open_tsap(struct ircomm_cb *self); -int ircomm_ttp_connect_request(struct ircomm_cb *self, - struct sk_buff *userdata, - struct ircomm_info *info); -int ircomm_ttp_connect_response(struct ircomm_cb *self, struct sk_buff *skb); -int ircomm_ttp_disconnect_request(struct ircomm_cb *self, - struct sk_buff *userdata, - struct ircomm_info *info); -int ircomm_ttp_data_request(struct ircomm_cb *self, struct sk_buff *skb, - int clen); -int ircomm_ttp_control_request(struct ircomm_cb *self, - struct sk_buff *userdata); -int ircomm_ttp_data_indication(void *instance, void *sap, - struct sk_buff *skb); -void ircomm_ttp_connect_confirm(void *instance, void *sap, - struct qos_info *qos, - __u32 max_sdu_size, - __u8 max_header_size, - struct sk_buff *skb); -void ircomm_ttp_connect_indication(void *instance, void *sap, - struct qos_info *qos, - __u32 max_sdu_size, - __u8 max_header_size, - struct sk_buff *skb); -void ircomm_ttp_disconnect_indication(void *instance, void *sap, - LM_REASON reason, - struct sk_buff *skb); -void ircomm_ttp_flow_indication(void *instance, void *sap, LOCAL_FLOW cmd); #endif - - - diff --git a/include/net/irda/ircomm_tty.h b/include/net/irda/ircomm_tty.h index 2ab995d723ac..87699cb4ef8c 100644 --- a/include/net/irda/ircomm_tty.h +++ b/include/net/irda/ircomm_tty.h @@ -118,10 +118,8 @@ struct ircomm_tty_cb { }; void ircomm_tty_start(struct tty_struct *tty); -void ircomm_tty_stop(struct tty_struct *tty); void ircomm_tty_check_modem_status(struct ircomm_tty_cb *self); -extern void ircomm_tty_change_speed(struct ircomm_tty_cb *self); extern int ircomm_tty_tiocmget(struct tty_struct *tty, struct file *file); extern int ircomm_tty_tiocmset(struct tty_struct *tty, struct file *file, unsigned int set, unsigned int clear); diff --git a/include/net/irda/ircomm_tty_attach.h b/include/net/irda/ircomm_tty_attach.h index 7f4656165adc..f91a5695aa44 100644 --- a/include/net/irda/ircomm_tty_attach.h +++ b/include/net/irda/ircomm_tty_attach.h @@ -67,7 +67,6 @@ struct ircomm_tty_info { }; extern char *ircomm_state[]; -extern char *ircomm_event[]; extern char *ircomm_tty_state[]; int ircomm_tty_do_event(struct ircomm_tty_cb *self, IRCOMM_TTY_EVENT event, diff --git a/include/net/irda/irda_device.h b/include/net/irda/irda_device.h index 2b245440b551..3b216f186f18 100644 --- a/include/net/irda/irda_device.h +++ b/include/net/irda/irda_device.h @@ -227,8 +227,6 @@ static inline int irda_device_txqueue_empty(const struct net_device *dev) return (skb_queue_len(&dev->qdisc->q) == 0); } int irda_device_set_raw_mode(struct net_device* self, int status); -int irda_device_set_dtr_rts(struct net_device *dev, int dtr, int rts); -int irda_device_change_speed(struct net_device *dev, __u32 speed); struct net_device *alloc_irdadev(int sizeof_priv); /* Dongle interface */ diff --git a/include/net/irda/iriap.h b/include/net/irda/iriap.h index ccd692fdef36..2007c5a0a43f 100644 --- a/include/net/irda/iriap.h +++ b/include/net/irda/iriap.h @@ -97,22 +97,12 @@ void iriap_close(struct iriap_cb *self); int iriap_getvaluebyclass_request(struct iriap_cb *self, __u32 saddr, __u32 daddr, char *name, char *attr); -void iriap_getvaluebyclass_confirm(struct iriap_cb *self, struct sk_buff *skb); void iriap_connect_request(struct iriap_cb *self); void iriap_send_ack( struct iriap_cb *self); void iriap_call_indication(struct iriap_cb *self, struct sk_buff *skb); void iriap_register_server(void); -void iriap_watchdog_timer_expired(void *data); - -static inline void iriap_start_watchdog_timer(struct iriap_cb *self, - int timeout) -{ - irda_start_timer(&self->watchdog_timer, timeout, self, - iriap_watchdog_timer_expired); -} - #endif diff --git a/include/net/irda/irlan_client.h b/include/net/irda/irlan_client.h index fb9389cebdd8..736dabe211e3 100644 --- a/include/net/irda/irlan_client.h +++ b/include/net/irda/irlan_client.h @@ -33,12 +33,9 @@ #include #include -void irlan_client_start_kick_timer(struct irlan_cb *self, int timeout); void irlan_client_discovery_indication(discinfo_t *, DISCOVERY_MODE, void *); void irlan_client_wakeup(struct irlan_cb *self, __u32 saddr, __u32 daddr); -void irlan_client_open_ctrl_tsap( struct irlan_cb *self); - void irlan_client_parse_response(struct irlan_cb *self, struct sk_buff *skb); void irlan_client_get_value_confirm(int result, __u16 obj_id, struct ias_value *value, void *priv); diff --git a/include/net/irda/irlan_common.h b/include/net/irda/irlan_common.h index 2c1548bdc87d..1c73bdbc3eb3 100644 --- a/include/net/irda/irlan_common.h +++ b/include/net/irda/irlan_common.h @@ -190,7 +190,6 @@ struct irlan_cb { struct timer_list watchdog_timer; }; -struct irlan_cb *irlan_open(__u32 saddr, __u32 daddr); void irlan_close(struct irlan_cb *self); void irlan_close_tsaps(struct irlan_cb *self); @@ -204,13 +203,11 @@ int irlan_run_ctrl_tx_queue(struct irlan_cb *self); struct irlan_cb *irlan_get_any(void); void irlan_get_provider_info(struct irlan_cb *self); -void irlan_get_unicast_addr(struct irlan_cb *self); void irlan_get_media_char(struct irlan_cb *self); void irlan_open_data_channel(struct irlan_cb *self); void irlan_close_data_channel(struct irlan_cb *self); void irlan_set_multicast_filter(struct irlan_cb *self, int status); void irlan_set_broadcast_filter(struct irlan_cb *self, int status); -void irlan_open_unicast_addr(struct irlan_cb *self); int irlan_insert_byte_param(struct sk_buff *skb, char *param, __u8 value); int irlan_insert_short_param(struct sk_buff *skb, char *param, __u16 value); diff --git a/include/net/irda/irlap.h b/include/net/irda/irlap.h index c7c2aecaf637..f55e86e75030 100644 --- a/include/net/irda/irlap.h +++ b/include/net/irda/irlap.h @@ -253,10 +253,8 @@ int irlap_validate_ns_received(struct irlap_cb *, int ns); int irlap_generate_rand_time_slot(int S, int s); void irlap_initiate_connection_state(struct irlap_cb *); void irlap_flush_all_queues(struct irlap_cb *); -void irlap_change_speed(struct irlap_cb *self, __u32 speed, int now); void irlap_wait_min_turn_around(struct irlap_cb *, struct qos_info *); -void irlap_init_qos_capabilities(struct irlap_cb *, struct qos_info *); void irlap_apply_default_connection_parameters(struct irlap_cb *self); void irlap_apply_connection_parameters(struct irlap_cb *self, int now); diff --git a/include/net/irda/irlap_frame.h b/include/net/irda/irlap_frame.h index 94c83bc2c4cc..3452ae257c84 100644 --- a/include/net/irda/irlap_frame.h +++ b/include/net/irda/irlap_frame.h @@ -133,7 +133,6 @@ void irlap_send_data_secondary_final(struct irlap_cb *, struct sk_buff *); void irlap_resend_rejected_frames(struct irlap_cb *, int command); void irlap_resend_rejected_frame(struct irlap_cb *self, int command); -void irlap_send_i_frame(struct irlap_cb *, struct sk_buff *, int command); void irlap_send_ui_frame(struct irlap_cb *self, struct sk_buff *skb, __u8 caddr, int command); diff --git a/include/net/irda/irlmp.h b/include/net/irda/irlmp.h index cf8d5af5cb36..86aefb1fda5e 100644 --- a/include/net/irda/irlmp.h +++ b/include/net/irda/irlmp.h @@ -242,12 +242,9 @@ int irlmp_connless_data_request(struct lsap_cb *, struct sk_buff *, __u8); void irlmp_connless_data_indication(struct lsap_cb *, struct sk_buff *); #endif /* CONFIG_IRDA_ULTRA */ -void irlmp_status_request(void); void irlmp_status_indication(struct lap_cb *, LINK_STATUS link, LOCK_STATUS lock); void irlmp_flow_indication(struct lap_cb *self, LOCAL_FLOW flow); -int irlmp_slsap_inuse(__u8 slsap); -__u8 irlmp_find_free_slsap(void); LM_REASON irlmp_convert_lap_reason(LAP_REASON); static inline __u32 irlmp_get_saddr(const struct lsap_cb *self) diff --git a/include/net/irda/irttp.h b/include/net/irda/irttp.h index 600d5411da17..a899e5837be8 100644 --- a/include/net/irda/irttp.h +++ b/include/net/irda/irttp.h @@ -167,9 +167,6 @@ int irttp_connect_response(struct tsap_cb *self, __u32 max_sdu_size, int irttp_disconnect_request(struct tsap_cb *self, struct sk_buff *skb, int priority); void irttp_flow_request(struct tsap_cb *self, LOCAL_FLOW flow); -void irttp_status_indication(void *instance, - LINK_STATUS link, LOCK_STATUS lock); -void irttp_flow_indication(void *instance, void *sap, LOCAL_FLOW flow); struct tsap_cb *irttp_dup(struct tsap_cb *self, void *instance); static __inline __u32 irttp_get_saddr(struct tsap_cb *self) diff --git a/include/net/irda/parameters.h b/include/net/irda/parameters.h index 3938975c0764..3a605d37ddbf 100644 --- a/include/net/irda/parameters.h +++ b/include/net/irda/parameters.h @@ -90,11 +90,9 @@ typedef struct { } pi_param_info_t; int irda_param_pack(__u8 *buf, char *fmt, ...); -int irda_param_unpack(__u8 *buf, char *fmt, ...); int irda_param_insert(void *self, __u8 pi, __u8 *buf, int len, pi_param_info_t *info); -int irda_param_extract(void *self, __u8 *buf, int len, pi_param_info_t *info); int irda_param_extract_all(void *self, __u8 *buf, int len, pi_param_info_t *info); diff --git a/include/net/irda/qos.h b/include/net/irda/qos.h index 41ee53f94c52..9ae3d6bc2423 100644 --- a/include/net/irda/qos.h +++ b/include/net/irda/qos.h @@ -87,7 +87,6 @@ void irda_init_max_qos_capabilies(struct qos_info *qos); void irda_qos_compute_intersection(struct qos_info *, struct qos_info *); __u32 irlap_max_line_capacity(__u32 speed, __u32 max_turn_time); -__u32 irlap_requested_line_capacity(struct qos_info *qos); void irda_qos_bits_to_value(struct qos_info *qos); diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c index bc6aa5db3bb5..5dd00fe097b6 100644 --- a/net/irda/af_irda.c +++ b/net/irda/af_irda.c @@ -298,7 +298,7 @@ static void irda_connect_indication(void *instance, void *sap, * Accept incoming connection * */ -void irda_connect_response(struct irda_sock *self) +static void irda_connect_response(struct irda_sock *self) { struct sk_buff *skb; @@ -1155,7 +1155,7 @@ static int irda_create(struct socket *sock, int protocol) * Destroy socket * */ -void irda_destroy_socket(struct irda_sock *self) +static void irda_destroy_socket(struct irda_sock *self) { IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self); diff --git a/net/irda/discovery.c b/net/irda/discovery.c index 645c86915d54..d16ef81552cf 100644 --- a/net/irda/discovery.c +++ b/net/irda/discovery.c @@ -315,41 +315,6 @@ struct irda_device_info *irlmp_copy_discoveries(hashbin_t *log, int *pn, return(buffer); } -/* - * Function irlmp_find_device (name, saddr) - * - * Look through the discovery log at each of the links and try to find - * the device with the given name. Return daddr and saddr. If saddr is - * specified, that look at that particular link only (not impl). - */ -__u32 irlmp_find_device(hashbin_t *cachelog, char *name, __u32 *saddr) -{ - unsigned long flags; - discovery_t *d; - - spin_lock_irqsave(&cachelog->hb_spinlock, flags); - - /* Look at all discoveries for that link */ - d = (discovery_t *) hashbin_get_first(cachelog); - while (d != NULL) { - IRDA_DEBUG(1, "Discovery:\n"); - IRDA_DEBUG(1, " daddr=%08x\n", d->data.daddr); - IRDA_DEBUG(1, " nickname=%s\n", d->data.info); - - if (strcmp(name, d->data.info) == 0) { - *saddr = d->data.saddr; - - spin_unlock_irqrestore(&cachelog->hb_spinlock, flags); - return d->data.daddr; - } - d = (discovery_t *) hashbin_get_next(cachelog); - } - - spin_unlock_irqrestore(&cachelog->hb_spinlock, flags); - - return 0; -} - #ifdef CONFIG_PROC_FS static inline discovery_t *discovery_seq_idx(loff_t pos) diff --git a/net/irda/ircomm/ircomm_core.c b/net/irda/ircomm/ircomm_core.c index 010d2b5764c1..36b75261d0ca 100644 --- a/net/irda/ircomm/ircomm_core.c +++ b/net/irda/ircomm/ircomm_core.c @@ -68,7 +68,7 @@ static struct file_operations ircomm_proc_fops = { hashbin_t *ircomm = NULL; -int __init ircomm_init(void) +static int __init ircomm_init(void) { ircomm = hashbin_new(HB_LOCK); if (ircomm == NULL) { @@ -89,7 +89,7 @@ int __init ircomm_init(void) return 0; } -void __exit ircomm_cleanup(void) +static void __exit ircomm_cleanup(void) { IRDA_DEBUG(2, "%s()\n", __FUNCTION__ ); diff --git a/net/irda/ircomm/ircomm_event.c b/net/irda/ircomm/ircomm_event.c index 3ad421cbea83..606b4e2a0a0f 100644 --- a/net/irda/ircomm/ircomm_event.c +++ b/net/irda/ircomm/ircomm_event.c @@ -57,7 +57,7 @@ char *ircomm_state[] = { "IRCOMM_CONN", }; -char *ircomm_event[] = { +static char *ircomm_event[] = { "IRCOMM_CONNECT_REQUEST", "IRCOMM_CONNECT_RESPONSE", "IRCOMM_TTP_CONNECT_INDICATION", diff --git a/net/irda/ircomm/ircomm_lmp.c b/net/irda/ircomm/ircomm_lmp.c index a773b35c66cb..3a0dc925a4aa 100644 --- a/net/irda/ircomm/ircomm_lmp.c +++ b/net/irda/ircomm/ircomm_lmp.c @@ -41,44 +41,6 @@ #include #include -/* - * Function ircomm_open_lsap (self) - * - * Open LSAP. This function will only be used when using "raw" services - * - */ -int ircomm_open_lsap(struct ircomm_cb *self) -{ - notify_t notify; - - IRDA_DEBUG(0, "%s()\n", __FUNCTION__ ); - - /* Register callbacks */ - irda_notify_init(¬ify); - notify.data_indication = ircomm_lmp_data_indication; - notify.connect_confirm = ircomm_lmp_connect_confirm; - notify.connect_indication = ircomm_lmp_connect_indication; - notify.disconnect_indication = ircomm_lmp_disconnect_indication; - notify.instance = self; - strlcpy(notify.name, "IrCOMM", sizeof(notify.name)); - - self->lsap = irlmp_open_lsap(LSAP_ANY, ¬ify, 0); - if (!self->lsap) { - IRDA_DEBUG(0,"%sfailed to allocate tsap\n", __FUNCTION__ ); - return -1; - } - self->slsap_sel = self->lsap->slsap_sel; - - /* - * Initialize the call-table for issuing commands - */ - self->issue.data_request = ircomm_lmp_data_request; - self->issue.connect_request = ircomm_lmp_connect_request; - self->issue.connect_response = ircomm_lmp_connect_response; - self->issue.disconnect_request = ircomm_lmp_disconnect_request; - - return 0; -} /* * Function ircomm_lmp_connect_request (self, userdata) @@ -86,9 +48,9 @@ int ircomm_open_lsap(struct ircomm_cb *self) * * */ -int ircomm_lmp_connect_request(struct ircomm_cb *self, - struct sk_buff *userdata, - struct ircomm_info *info) +static int ircomm_lmp_connect_request(struct ircomm_cb *self, + struct sk_buff *userdata, + struct ircomm_info *info) { int ret = 0; @@ -109,7 +71,8 @@ int ircomm_lmp_connect_request(struct ircomm_cb *self, * * */ -int ircomm_lmp_connect_response(struct ircomm_cb *self, struct sk_buff *userdata) +static int ircomm_lmp_connect_response(struct ircomm_cb *self, + struct sk_buff *userdata) { struct sk_buff *tx_skb; int ret; @@ -141,9 +104,9 @@ int ircomm_lmp_connect_response(struct ircomm_cb *self, struct sk_buff *userdata return 0; } -int ircomm_lmp_disconnect_request(struct ircomm_cb *self, - struct sk_buff *userdata, - struct ircomm_info *info) +static int ircomm_lmp_disconnect_request(struct ircomm_cb *self, + struct sk_buff *userdata, + struct ircomm_info *info) { struct sk_buff *tx_skb; int ret; @@ -175,7 +138,7 @@ int ircomm_lmp_disconnect_request(struct ircomm_cb *self, * been deallocated. We do this to make sure we don't flood IrLAP with * frames, since we are not using the IrTTP flow control mechanism */ -void ircomm_lmp_flow_control(struct sk_buff *skb) +static void ircomm_lmp_flow_control(struct sk_buff *skb) { struct irda_skb_cb *cb; struct ircomm_cb *self; @@ -215,8 +178,9 @@ void ircomm_lmp_flow_control(struct sk_buff *skb) * Send data frame to peer device * */ -int ircomm_lmp_data_request(struct ircomm_cb *self, struct sk_buff *skb, - int not_used) +static int ircomm_lmp_data_request(struct ircomm_cb *self, + struct sk_buff *skb, + int not_used) { struct irda_skb_cb *cb; int ret; @@ -256,8 +220,8 @@ int ircomm_lmp_data_request(struct ircomm_cb *self, struct sk_buff *skb, * Incoming data which we must deliver to the state machine, to check * we are still connected. */ -int ircomm_lmp_data_indication(void *instance, void *sap, - struct sk_buff *skb) +static int ircomm_lmp_data_indication(void *instance, void *sap, + struct sk_buff *skb) { struct ircomm_cb *self = (struct ircomm_cb *) instance; @@ -282,11 +246,11 @@ int ircomm_lmp_data_indication(void *instance, void *sap, * Connection has been confirmed by peer device * */ -void ircomm_lmp_connect_confirm(void *instance, void *sap, - struct qos_info *qos, - __u32 max_seg_size, - __u8 max_header_size, - struct sk_buff *skb) +static void ircomm_lmp_connect_confirm(void *instance, void *sap, + struct qos_info *qos, + __u32 max_seg_size, + __u8 max_header_size, + struct sk_buff *skb) { struct ircomm_cb *self = (struct ircomm_cb *) instance; struct ircomm_info info; @@ -315,11 +279,11 @@ void ircomm_lmp_connect_confirm(void *instance, void *sap, * Peer device wants to make a connection with us * */ -void ircomm_lmp_connect_indication(void *instance, void *sap, - struct qos_info *qos, - __u32 max_seg_size, - __u8 max_header_size, - struct sk_buff *skb) +static void ircomm_lmp_connect_indication(void *instance, void *sap, + struct qos_info *qos, + __u32 max_seg_size, + __u8 max_header_size, + struct sk_buff *skb) { struct ircomm_cb *self = (struct ircomm_cb *)instance; struct ircomm_info info; @@ -347,9 +311,9 @@ void ircomm_lmp_connect_indication(void *instance, void *sap, * Peer device has closed the connection, or the link went down for some * other reason */ -void ircomm_lmp_disconnect_indication(void *instance, void *sap, - LM_REASON reason, - struct sk_buff *skb) +static void ircomm_lmp_disconnect_indication(void *instance, void *sap, + LM_REASON reason, + struct sk_buff *skb) { struct ircomm_cb *self = (struct ircomm_cb *) instance; struct ircomm_info info; @@ -367,3 +331,41 @@ void ircomm_lmp_disconnect_indication(void *instance, void *sap, if(skb) dev_kfree_skb(skb); } +/* + * Function ircomm_open_lsap (self) + * + * Open LSAP. This function will only be used when using "raw" services + * + */ +int ircomm_open_lsap(struct ircomm_cb *self) +{ + notify_t notify; + + IRDA_DEBUG(0, "%s()\n", __FUNCTION__ ); + + /* Register callbacks */ + irda_notify_init(¬ify); + notify.data_indication = ircomm_lmp_data_indication; + notify.connect_confirm = ircomm_lmp_connect_confirm; + notify.connect_indication = ircomm_lmp_connect_indication; + notify.disconnect_indication = ircomm_lmp_disconnect_indication; + notify.instance = self; + strlcpy(notify.name, "IrCOMM", sizeof(notify.name)); + + self->lsap = irlmp_open_lsap(LSAP_ANY, ¬ify, 0); + if (!self->lsap) { + IRDA_DEBUG(0,"%sfailed to allocate tsap\n", __FUNCTION__ ); + return -1; + } + self->slsap_sel = self->lsap->slsap_sel; + + /* + * Initialize the call-table for issuing commands + */ + self->issue.data_request = ircomm_lmp_data_request; + self->issue.connect_request = ircomm_lmp_connect_request; + self->issue.connect_response = ircomm_lmp_connect_response; + self->issue.disconnect_request = ircomm_lmp_disconnect_request; + + return 0; +} diff --git a/net/irda/ircomm/ircomm_param.c b/net/irda/ircomm/ircomm_param.c index dee0c8917c18..703e8aa31c75 100644 --- a/net/irda/ircomm/ircomm_param.c +++ b/net/irda/ircomm/ircomm_param.c @@ -91,23 +91,6 @@ static pi_major_info_t pi_major_call_table[] = { pi_param_info_t ircomm_param_info = { pi_major_call_table, 3, 0x0f, 4 }; -/* - * Function ircomm_param_flush (self) - * - * Flush (send) out all queued parameters - * - */ -int ircomm_param_flush(struct ircomm_tty_cb *self) -{ - /* we should lock here, but I guess this function is unused... - * Jean II */ - if (self->ctrl_skb) { - ircomm_control_request(self->ircomm, self->ctrl_skb); - self->ctrl_skb = NULL; - } - return 0; -} - /* * Function ircomm_param_request (self, pi, flush) * diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c index eb430e81d02f..f75949d277bb 100644 --- a/net/irda/ircomm/ircomm_tty.c +++ b/net/irda/ircomm/ircomm_tty.c @@ -64,6 +64,7 @@ static void ircomm_tty_wait_until_sent(struct tty_struct *tty, int timeout); static void ircomm_tty_hangup(struct tty_struct *tty); static void ircomm_tty_do_softint(void *private_); static void ircomm_tty_shutdown(struct ircomm_tty_cb *self); +static void ircomm_tty_stop(struct tty_struct *tty); static int ircomm_tty_data_indication(void *instance, void *sap, struct sk_buff *skb); @@ -108,7 +109,7 @@ static struct tty_operations ops = { * Init IrCOMM TTY layer/driver * */ -int __init ircomm_tty_init(void) +static int __init ircomm_tty_init(void) { driver = alloc_tty_driver(IRCOMM_TTY_PORTS); if (!driver) @@ -159,7 +160,7 @@ static void __exit __ircomm_tty_cleanup(struct ircomm_tty_cb *self) * Remove IrCOMM TTY layer/driver * */ -void __exit ircomm_tty_cleanup(void) +static void __exit ircomm_tty_cleanup(void) { int ret; @@ -1064,7 +1065,7 @@ void ircomm_tty_start(struct tty_struct *tty) * This routine notifies the tty driver that it should stop outputting * characters to the tty device. */ -void ircomm_tty_stop(struct tty_struct *tty) +static void ircomm_tty_stop(struct tty_struct *tty) { struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; diff --git a/net/irda/ircomm/ircomm_tty_attach.c b/net/irda/ircomm/ircomm_tty_attach.c index fb9991390fff..41a6aa415040 100644 --- a/net/irda/ircomm/ircomm_tty_attach.c +++ b/net/irda/ircomm/ircomm_tty_attach.c @@ -52,8 +52,9 @@ static void ircomm_tty_discovery_indication(discinfo_t *discovery, void *priv); static void ircomm_tty_getvalue_confirm(int result, __u16 obj_id, struct ias_value *value, void *priv); -void ircomm_tty_start_watchdog_timer(struct ircomm_tty_cb *self, int timeout); -void ircomm_tty_watchdog_timer_expired(void *data); +static void ircomm_tty_start_watchdog_timer(struct ircomm_tty_cb *self, + int timeout); +static void ircomm_tty_watchdog_timer_expired(void *data); static int ircomm_tty_state_idle(struct ircomm_tty_cb *self, IRCOMM_TTY_EVENT event, @@ -90,7 +91,7 @@ char *ircomm_tty_state[] = { "*** ERROR *** ", }; -char *ircomm_tty_event[] = { +static char *ircomm_tty_event[] = { "IRCOMM_TTY_ATTACH_CABLE", "IRCOMM_TTY_DETACH_CABLE", "IRCOMM_TTY_DATA_REQUEST", @@ -594,7 +595,8 @@ void ircomm_tty_link_established(struct ircomm_tty_cb *self) * connection attempt is successful, and if not, we will retry after * the timeout */ -void ircomm_tty_start_watchdog_timer(struct ircomm_tty_cb *self, int timeout) +static void ircomm_tty_start_watchdog_timer(struct ircomm_tty_cb *self, + int timeout) { ASSERT(self != NULL, return;); ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;); @@ -609,7 +611,7 @@ void ircomm_tty_start_watchdog_timer(struct ircomm_tty_cb *self, int timeout) * Called when the connect procedure have taken to much time. * */ -void ircomm_tty_watchdog_timer_expired(void *data) +static void ircomm_tty_watchdog_timer_expired(void *data) { struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) data; diff --git a/net/irda/ircomm/ircomm_tty_ioctl.c b/net/irda/ircomm/ircomm_tty_ioctl.c index 40965158a75f..001611d3302e 100644 --- a/net/irda/ircomm/ircomm_tty_ioctl.c +++ b/net/irda/ircomm/ircomm_tty_ioctl.c @@ -53,7 +53,7 @@ * Change speed of the driver. If the remote device is a DCE, then this * should make it change the speed of its serial port */ -void ircomm_tty_change_speed(struct ircomm_tty_cb *self) +static void ircomm_tty_change_speed(struct ircomm_tty_cb *self) { unsigned cflag, cval; int baud; diff --git a/net/irda/irda_device.c b/net/irda/irda_device.c index 80a6648a4043..cf5a849bf4c0 100644 --- a/net/irda/irda_device.c +++ b/net/irda/irda_device.c @@ -143,47 +143,6 @@ void irda_device_set_media_busy(struct net_device *dev, int status) EXPORT_SYMBOL(irda_device_set_media_busy); -int irda_device_set_dtr_rts(struct net_device *dev, int dtr, int rts) -{ - struct if_irda_req req; - int ret; - - IRDA_DEBUG(2, "%s()\n", __FUNCTION__); - - if (!dev->do_ioctl) { - ERROR("%s: do_ioctl not impl. by device driver\n", - __FUNCTION__); - return -1; - } - - req.ifr_dtr = dtr; - req.ifr_rts = rts; - - ret = dev->do_ioctl(dev, (struct ifreq *) &req, SIOCSDTRRTS); - - return ret; -} - -int irda_device_change_speed(struct net_device *dev, __u32 speed) -{ - struct if_irda_req req; - int ret; - - IRDA_DEBUG(2, "%s()\n", __FUNCTION__); - - if (!dev->do_ioctl) { - ERROR("%s: do_ioctl not impl. by device driver\n", - __FUNCTION__); - return -1; - } - - req.ifr_baudrate = speed; - - ret = dev->do_ioctl(dev, (struct ifreq *) &req, SIOCSBANDWIDTH); - - return ret; -} - /* * Function irda_device_is_receiving (dev) * @@ -372,7 +331,7 @@ static void irda_task_timer_expired(void *data) * This function should be used by low level device drivers in a similar way * as ether_setup() is used by normal network device drivers */ -void irda_device_setup(struct net_device *dev) +static void irda_device_setup(struct net_device *dev) { dev->hard_header_len = 0; dev->addr_len = 0; @@ -502,33 +461,6 @@ void irda_device_unregister_dongle(struct dongle_reg *dongle) } EXPORT_SYMBOL(irda_device_unregister_dongle); -/* - * Function irda_device_set_mode (self, mode) - * - * Set the Infrared device driver into mode where it sends and receives - * data without using IrLAP framing. Check out the particular device - * driver to find out which modes it support. - */ -int irda_device_set_mode(struct net_device* dev, int mode) -{ - struct if_irda_req req; - int ret; - - IRDA_DEBUG(0, "%s()\n", __FUNCTION__); - - if (!dev->do_ioctl) { - ERROR("%s: set_raw_mode not impl. by device driver\n", - __FUNCTION__); - return -1; - } - - req.ifr_mode = mode; - - ret = dev->do_ioctl(dev, (struct ifreq *) &req, SIOCSMODE); - - return ret; -} - #ifdef CONFIG_ISA /* * Function setup_dma (idev, buffer, count, mode) diff --git a/net/irda/iriap.c b/net/irda/iriap.c index 7810c6da23d6..f22993c24ea8 100644 --- a/net/irda/iriap.c +++ b/net/irda/iriap.c @@ -77,6 +77,15 @@ static void iriap_connect_confirm(void *instance, void *sap, static int iriap_data_indication(void *instance, void *sap, struct sk_buff *skb); +static void iriap_watchdog_timer_expired(void *data); + +static inline void iriap_start_watchdog_timer(struct iriap_cb *self, + int timeout) +{ + irda_start_timer(&self->watchdog_timer, timeout, self, + iriap_watchdog_timer_expired); +} + /* * Function iriap_init (void) * @@ -328,7 +337,7 @@ static void iriap_disconnect_indication(void *instance, void *sap, /* * Function iriap_disconnect_request (handle) */ -void iriap_disconnect_request(struct iriap_cb *self) +static void iriap_disconnect_request(struct iriap_cb *self) { struct sk_buff *tx_skb; @@ -352,31 +361,6 @@ void iriap_disconnect_request(struct iriap_cb *self) irlmp_disconnect_request(self->lsap, tx_skb); } -void iriap_getinfobasedetails_request(void) -{ - IRDA_DEBUG(0, "%s(), Not implemented!\n", __FUNCTION__); -} - -void iriap_getinfobasedetails_confirm(void) -{ - IRDA_DEBUG(0, "%s(), Not implemented!\n", __FUNCTION__); -} - -void iriap_getobjects_request(void) -{ - IRDA_DEBUG(0, "%s(), Not implemented!\n", __FUNCTION__); -} - -void iriap_getobjects_confirm(void) -{ - IRDA_DEBUG(0, "%s(), Not implemented!\n", __FUNCTION__); -} - -void iriap_getvalue(void) -{ - IRDA_DEBUG(0, "%s(), Not implemented!\n", __FUNCTION__); -} - /* * Function iriap_getvaluebyclass (addr, name, attr) * @@ -445,7 +429,8 @@ EXPORT_SYMBOL(iriap_getvaluebyclass_request); * to service user. * */ -void iriap_getvaluebyclass_confirm(struct iriap_cb *self, struct sk_buff *skb) +static void iriap_getvaluebyclass_confirm(struct iriap_cb *self, + struct sk_buff *skb) { struct ias_value *value; int charset; @@ -552,8 +537,10 @@ void iriap_getvaluebyclass_confirm(struct iriap_cb *self, struct sk_buff *skb) * Send answer back to remote LM-IAS * */ -void iriap_getvaluebyclass_response(struct iriap_cb *self, __u16 obj_id, - __u8 ret_code, struct ias_value *value) +static void iriap_getvaluebyclass_response(struct iriap_cb *self, + __u16 obj_id, + __u8 ret_code, + struct ias_value *value) { struct sk_buff *tx_skb; int n; @@ -641,8 +628,8 @@ void iriap_getvaluebyclass_response(struct iriap_cb *self, __u16 obj_id, * getvaluebyclass is requested from peer LM-IAS * */ -void iriap_getvaluebyclass_indication(struct iriap_cb *self, - struct sk_buff *skb) +static void iriap_getvaluebyclass_indication(struct iriap_cb *self, + struct sk_buff *skb) { struct ias_object *obj; struct ias_attrib *attrib; @@ -962,7 +949,7 @@ void iriap_call_indication(struct iriap_cb *self, struct sk_buff *skb) * Query has taken too long time, so abort * */ -void iriap_watchdog_timer_expired(void *data) +static void iriap_watchdog_timer_expired(void *data) { struct iriap_cb *self = (struct iriap_cb *) data; diff --git a/net/irda/irias_object.c b/net/irda/irias_object.c index bc8d74df1563..98c9e1517a2f 100644 --- a/net/irda/irias_object.c +++ b/net/irda/irias_object.c @@ -116,7 +116,7 @@ EXPORT_SYMBOL(irias_new_object); * Delete given attribute and deallocate all its memory * */ -void __irias_delete_attrib(struct ias_attrib *attrib) +static void __irias_delete_attrib(struct ias_attrib *attrib) { ASSERT(attrib != NULL, return;); ASSERT(attrib->magic == IAS_ATTRIB_MAGIC, return;); @@ -267,8 +267,8 @@ EXPORT_SYMBOL(irias_find_attrib); * Add attribute to object * */ -void irias_add_attrib( struct ias_object *obj, struct ias_attrib *attrib, - int owner) +static void irias_add_attrib(struct ias_object *obj, struct ias_attrib *attrib, + int owner) { ASSERT(obj != NULL, return;); ASSERT(obj->magic == IAS_OBJECT_MAGIC, return;); diff --git a/net/irda/irlan/irlan_client.c b/net/irda/irlan/irlan_client.c index 90c8221654f9..92dbe620340e 100644 --- a/net/irda/irlan/irlan_client.c +++ b/net/irda/irlan/irlan_client.c @@ -66,6 +66,7 @@ static void irlan_client_ctrl_connect_confirm(void *instance, void *sap, struct sk_buff *); static void irlan_check_response_param(struct irlan_cb *self, char *param, char *value, int val_len); +static void irlan_client_open_ctrl_tsap(struct irlan_cb *self); static void irlan_client_kick_timer_expired(void *data) { @@ -88,7 +89,7 @@ static void irlan_client_kick_timer_expired(void *data) } } -void irlan_client_start_kick_timer(struct irlan_cb *self, int timeout) +static void irlan_client_start_kick_timer(struct irlan_cb *self, int timeout) { IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); @@ -248,7 +249,7 @@ static void irlan_client_ctrl_disconnect_indication(void *instance, void *sap, * Initialize callbacks and open IrTTP TSAPs * */ -void irlan_client_open_ctrl_tsap(struct irlan_cb *self) +static void irlan_client_open_ctrl_tsap(struct irlan_cb *self) { struct tsap_cb *tsap; notify_t notify; @@ -308,42 +309,6 @@ static void irlan_client_ctrl_connect_confirm(void *instance, void *sap, irlan_do_client_event(self, IRLAN_CONNECT_COMPLETE, NULL); } -/* - * Function irlan_client_reconnect_data_channel (self) - * - * Try to reconnect data channel (currently not used) - * - */ -void irlan_client_reconnect_data_channel(struct irlan_cb *self) -{ - struct sk_buff *skb; - __u8 *frame; - - IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); - - ASSERT(self != NULL, return;); - ASSERT(self->magic == IRLAN_MAGIC, return;); - - skb = dev_alloc_skb(128); - if (!skb) - return; - - /* Reserve space for TTP, LMP, and LAP header */ - skb_reserve(skb, self->max_header_size); - skb_put(skb, 2); - - frame = skb->data; - - frame[0] = CMD_RECONNECT_DATA_CHAN; - frame[1] = 0x01; - irlan_insert_array_param(skb, "RECONNECT_KEY", - self->client.reconnect_key, - self->client.key_len); - - irttp_data_request(self->client.tsap_ctrl, skb); -} - - /* * Function print_ret_code (code) * diff --git a/net/irda/irlan/irlan_common.c b/net/irda/irlan/irlan_common.c index 032ab40f913a..fd9f3043119b 100644 --- a/net/irda/irlan/irlan_common.c +++ b/net/irda/irlan/irlan_common.c @@ -105,10 +105,13 @@ static struct file_operations irlan_fops = { extern struct proc_dir_entry *proc_irda; #endif /* CONFIG_PROC_FS */ +static struct irlan_cb *irlan_open(__u32 saddr, __u32 daddr); static void __irlan_close(struct irlan_cb *self); static int __irlan_insert_param(struct sk_buff *skb, char *param, int type, __u8 value_byte, __u16 value_short, __u8 *value_array, __u16 value_len); +static void irlan_open_unicast_addr(struct irlan_cb *self); +static void irlan_get_unicast_addr(struct irlan_cb *self); void irlan_close_tsaps(struct irlan_cb *self); /* @@ -185,7 +188,7 @@ static void __exit irlan_cleanup(void) * Open new instance of a client/provider, we should only register the * network device if this instance is ment for a particular client/provider */ -struct irlan_cb *irlan_open(__u32 saddr, __u32 daddr) +static struct irlan_cb *irlan_open(__u32 saddr, __u32 daddr) { struct net_device *dev; struct irlan_cb *self; @@ -294,9 +297,11 @@ struct irlan_cb *irlan_get_any(void) * Here we receive the connect indication for the data channel * */ -void irlan_connect_indication(void *instance, void *sap, struct qos_info *qos, - __u32 max_sdu_size, __u8 max_header_size, - struct sk_buff *skb) +static void irlan_connect_indication(void *instance, void *sap, + struct qos_info *qos, + __u32 max_sdu_size, + __u8 max_header_size, + struct sk_buff *skb) { struct irlan_cb *self; struct tsap_cb *tsap; @@ -339,9 +344,11 @@ void irlan_connect_indication(void *instance, void *sap, struct qos_info *qos, netif_start_queue(self->dev); /* Clear reason */ } -void irlan_connect_confirm(void *instance, void *sap, struct qos_info *qos, - __u32 max_sdu_size, __u8 max_header_size, - struct sk_buff *skb) +static void irlan_connect_confirm(void *instance, void *sap, + struct qos_info *qos, + __u32 max_sdu_size, + __u8 max_header_size, + struct sk_buff *skb) { struct irlan_cb *self; @@ -384,8 +391,9 @@ void irlan_connect_confirm(void *instance, void *sap, struct qos_info *qos, * Callback function for the IrTTP layer. Indicates a disconnection of * the specified connection (handle) */ -void irlan_disconnect_indication(void *instance, void *sap, LM_REASON reason, - struct sk_buff *userdata) +static void irlan_disconnect_indication(void *instance, + void *sap, LM_REASON reason, + struct sk_buff *userdata) { struct irlan_cb *self; struct tsap_cb *tsap; @@ -602,7 +610,7 @@ int irlan_run_ctrl_tx_queue(struct irlan_cb *self) * This function makes sure that commands on the control channel is being * sent in a command/response fashion */ -void irlan_ctrl_data_request(struct irlan_cb *self, struct sk_buff *skb) +static void irlan_ctrl_data_request(struct irlan_cb *self, struct sk_buff *skb) { IRDA_DEBUG(2, "%s()\n", __FUNCTION__ ); @@ -722,7 +730,7 @@ void irlan_close_data_channel(struct irlan_cb *self) * address. * */ -void irlan_open_unicast_addr(struct irlan_cb *self) +static void irlan_open_unicast_addr(struct irlan_cb *self) { struct sk_buff *skb; __u8 *frame; @@ -839,7 +847,7 @@ void irlan_set_multicast_filter(struct irlan_cb *self, int status) * can construct its packets. * */ -void irlan_get_unicast_addr(struct irlan_cb *self) +static void irlan_get_unicast_addr(struct irlan_cb *self) { struct sk_buff *skb; __u8 *frame; diff --git a/net/irda/irlan/irlan_provider.c b/net/irda/irlan/irlan_provider.c index 2793c54f3462..406d78a5f659 100644 --- a/net/irda/irlan/irlan_provider.c +++ b/net/irda/irlan/irlan_provider.c @@ -175,9 +175,9 @@ void irlan_provider_connect_response(struct irlan_cb *self, irttp_connect_response(tsap, IRLAN_MTU, NULL); } -void irlan_provider_disconnect_indication(void *instance, void *sap, - LM_REASON reason, - struct sk_buff *userdata) +static void irlan_provider_disconnect_indication(void *instance, void *sap, + LM_REASON reason, + struct sk_buff *userdata) { struct irlan_cb *self; struct tsap_cb *tsap; diff --git a/net/irda/irlap.c b/net/irda/irlap.c index 4466b69182a7..44fd6aa43171 100644 --- a/net/irda/irlap.c +++ b/net/irda/irlap.c @@ -60,6 +60,8 @@ int sysctl_warn_noreply_time = 3; extern void irlap_queue_xmit(struct irlap_cb *self, struct sk_buff *skb); static void __irlap_close(struct irlap_cb *self); +static void irlap_init_qos_capabilities(struct irlap_cb *self, + struct qos_info *qos_user); #ifdef CONFIG_IRDA_DEBUG static char *lap_reasons[] = { @@ -867,7 +869,7 @@ void irlap_flush_all_queues(struct irlap_cb *self) * Change the speed of the IrDA port * */ -void irlap_change_speed(struct irlap_cb *self, __u32 speed, int now) +static void irlap_change_speed(struct irlap_cb *self, __u32 speed, int now) { struct sk_buff *skb; @@ -894,8 +896,8 @@ void irlap_change_speed(struct irlap_cb *self, __u32 speed, int now) * IrLAP itself. Normally, IrLAP will not specify any values, but it can * be used to restrict certain values. */ -void irlap_init_qos_capabilities(struct irlap_cb *self, - struct qos_info *qos_user) +static void irlap_init_qos_capabilities(struct irlap_cb *self, + struct qos_info *qos_user) { ASSERT(self != NULL, return;); ASSERT(self->magic == LAP_MAGIC, return;); diff --git a/net/irda/irlap_event.c b/net/irda/irlap_event.c index 97ed757b844f..570a296c8530 100644 --- a/net/irda/irlap_event.c +++ b/net/irda/irlap_event.c @@ -181,7 +181,7 @@ static void irlap_poll_timer_expired(void *data) * Make sure that state is XMIT_P/XMIT_S when calling this function * (and that nobody messed up with the state). - Jean II */ -void irlap_start_poll_timer(struct irlap_cb *self, int timeout) +static void irlap_start_poll_timer(struct irlap_cb *self, int timeout) { ASSERT(self != NULL, return;); ASSERT(self->magic == LAP_MAGIC, return;); diff --git a/net/irda/irlap_frame.c b/net/irda/irlap_frame.c index 388f4ea83e1a..346c95eb46dd 100644 --- a/net/irda/irlap_frame.c +++ b/net/irda/irlap_frame.c @@ -43,6 +43,9 @@ #include #include +static void irlap_send_i_frame(struct irlap_cb *self, struct sk_buff *skb, + int command); + /* * Function irlap_insert_info (self, skb) * @@ -629,34 +632,6 @@ static inline void irlap_recv_rr_frame(struct irlap_cb *self, irlap_do_event(self, RECV_RR_RSP, skb, info); } -void irlap_send_frmr_frame( struct irlap_cb *self, int command) -{ - struct sk_buff *tx_skb = NULL; - __u8 *frame; - - ASSERT( self != NULL, return;); - ASSERT( self->magic == LAP_MAGIC, return;); - - tx_skb = dev_alloc_skb( 32); - if (!tx_skb) - return; - - frame = skb_put(tx_skb, 2); - - frame[0] = self->caddr; - frame[0] |= (command) ? CMD_FRAME : 0; - - frame[1] = (self->vs << 1); - frame[1] |= PF_BIT; - frame[1] |= (self->vr << 5); - - frame[2] = 0; - - IRDA_DEBUG(4, "%s(), vr=%d, %ld\n", __FUNCTION__, self->vr, jiffies); - - irlap_queue_xmit(self, tx_skb); -} - /* * Function irlap_recv_rnr_frame (self, skb, info) * @@ -1129,8 +1104,8 @@ void irlap_send_ui_frame(struct irlap_cb *self, struct sk_buff *skb, * * Contruct and transmit Information (I) frame */ -void irlap_send_i_frame(struct irlap_cb *self, struct sk_buff *skb, - int command) +static void irlap_send_i_frame(struct irlap_cb *self, struct sk_buff *skb, + int command) { /* Insert connection address */ skb->data[0] = self->caddr; diff --git a/net/irda/irlmp.c b/net/irda/irlmp.c index f0adafd6fc3b..26b22f49076b 100644 --- a/net/irda/irlmp.c +++ b/net/irda/irlmp.c @@ -44,6 +44,9 @@ #include #include +static __u8 irlmp_find_free_slsap(void); +static int irlmp_slsap_inuse(__u8 slsap_sel); + /* Master structure */ struct irlmp_cb *irlmp = NULL; @@ -1278,11 +1281,6 @@ void irlmp_connless_data_indication(struct lsap_cb *self, struct sk_buff *skb) } #endif /* CONFIG_IRDA_ULTRA */ -void irlmp_status_request(void) -{ - IRDA_DEBUG(0, "%s(), Not implemented\n", __FUNCTION__); -} - /* * Propagate status indication from LAP to LSAPs (via LMP) * This don't trigger any change of state in lap_cb, lmp_cb or lsap_cb, @@ -1656,7 +1654,7 @@ EXPORT_SYMBOL(irlmp_unregister_client); * of the allocated LSAP, but I'm not sure the complexity is worth it. * Jean II */ -int irlmp_slsap_inuse(__u8 slsap_sel) +static int irlmp_slsap_inuse(__u8 slsap_sel) { struct lsap_cb *self; struct lap_cb *lap; @@ -1756,7 +1754,7 @@ erruncon: * Find a free source LSAP to use. This function is called if the service * user has requested a source LSAP equal to LM_ANY */ -__u8 irlmp_find_free_slsap(void) +static __u8 irlmp_find_free_slsap(void) { __u8 lsap_sel; int wrapped = 0; diff --git a/net/irda/irmod.c b/net/irda/irmod.c index 7ecc67c0a9ae..6ffaed4544e9 100644 --- a/net/irda/irmod.c +++ b/net/irda/irmod.c @@ -100,7 +100,7 @@ EXPORT_SYMBOL(irda_notify_init); * Protocol stack initialisation entry point. * Initialise the various components of the IrDA stack */ -int __init irda_init(void) +static int __init irda_init(void) { IRDA_DEBUG(0, "%s()\n", __FUNCTION__); @@ -136,7 +136,7 @@ int __init irda_init(void) * Protocol stack cleanup/removal entry point. * Cleanup the various components of the IrDA stack */ -void __exit irda_cleanup(void) +static void __exit irda_cleanup(void) { /* Remove External APIs */ #ifdef CONFIG_SYSCTL diff --git a/net/irda/irnet/irnet.h b/net/irda/irnet/irnet.h index 0ed25a123047..0f33e4309f4f 100644 --- a/net/irda/irnet/irnet.h +++ b/net/irda/irnet/irnet.h @@ -520,8 +520,6 @@ extern void /* ---------------------------- MODULE ---------------------------- */ extern int irnet_init(void); /* Initialise IrNET module */ -extern void - irnet_cleanup(void); /* Teardown IrNET module */ /**************************** VARIABLES ****************************/ diff --git a/net/irda/irnet/irnet_ppp.c b/net/irda/irnet/irnet_ppp.c index 24748b614f3f..123f92fb63a6 100644 --- a/net/irda/irnet/irnet_ppp.c +++ b/net/irda/irnet/irnet_ppp.c @@ -16,6 +16,12 @@ #include "irnet_ppp.h" /* Private header */ /* Please put other headers in irnet.h - Thanks */ +/* Generic PPP callbacks (to call us) */ +static struct ppp_channel_ops irnet_ppp_ops = { + .start_xmit = ppp_irnet_send, + .ioctl = ppp_irnet_ioctl +}; + /************************* CONTROL CHANNEL *************************/ /* * When a pppd instance is not active on /dev/irnet, it acts as a control @@ -1095,7 +1101,7 @@ irnet_init(void) /* * Module exit */ -void __exit +static void __exit irnet_cleanup(void) { irda_irnet_cleanup(); diff --git a/net/irda/irnet/irnet_ppp.h b/net/irda/irnet/irnet_ppp.h index 8b4e06c55d5a..d2beb7df8f7f 100644 --- a/net/irda/irnet/irnet_ppp.h +++ b/net/irda/irnet/irnet_ppp.h @@ -116,11 +116,4 @@ static struct miscdevice irnet_misc_device = &irnet_device_fops }; -/* Generic PPP callbacks (to call us) */ -struct ppp_channel_ops irnet_ppp_ops = -{ - ppp_irnet_send, - ppp_irnet_ioctl -}; - #endif /* IRNET_PPP_H */ diff --git a/net/irda/irsysctl.c b/net/irda/irsysctl.c index cdcb320b56d1..1b1c4193359a 100644 --- a/net/irda/irsysctl.c +++ b/net/irda/irsysctl.c @@ -43,7 +43,6 @@ extern int sysctl_discovery_slots; extern int sysctl_discovery_timeout; extern int sysctl_slot_timeout; extern int sysctl_fast_poll_increase; -int sysctl_compression = 0; extern char sysctl_devname[]; extern int sysctl_max_baud_rate; extern int sysctl_min_tx_turn_time; diff --git a/net/irda/irttp.c b/net/irda/irttp.c index 093c362e0029..1a8d3b17aee2 100644 --- a/net/irda/irttp.c +++ b/net/irda/irttp.c @@ -64,6 +64,10 @@ static void irttp_todo_expired(unsigned long data); static int irttp_param_max_sdu_size(void *instance, irda_param_t *param, int get); +static void irttp_flow_indication(void *instance, void *sap, LOCAL_FLOW flow); +static void irttp_status_indication(void *instance, + LINK_STATUS link, LOCK_STATUS lock); + /* Information for parsing parameters in IrTTP */ static pi_minor_info_t pi_minor_call_table[] = { { NULL, 0 }, /* 0x00 */ @@ -961,8 +965,8 @@ static int irttp_data_indication(void *instance, void *sap, * Status_indication, just pass to the higher layer... * */ -void irttp_status_indication(void *instance, - LINK_STATUS link, LOCK_STATUS lock) +static void irttp_status_indication(void *instance, + LINK_STATUS link, LOCK_STATUS lock) { struct tsap_cb *self; @@ -993,7 +997,7 @@ void irttp_status_indication(void *instance, * Flow_indication : IrLAP tells us to send more data. * */ -void irttp_flow_indication(void *instance, void *sap, LOCAL_FLOW flow) +static void irttp_flow_indication(void *instance, void *sap, LOCAL_FLOW flow) { struct tsap_cb *self; @@ -1613,7 +1617,7 @@ void irttp_disconnect_indication(void *instance, void *sap, LM_REASON reason, * for some reason should fail. We mark rx sdu as busy to apply back * pressure is necessary. */ -void irttp_do_data_indication(struct tsap_cb *self, struct sk_buff *skb) +static void irttp_do_data_indication(struct tsap_cb *self, struct sk_buff *skb) { int err; diff --git a/net/irda/parameters.c b/net/irda/parameters.c index 2136b4441913..9d26cba2c3eb 100644 --- a/net/irda/parameters.c +++ b/net/irda/parameters.c @@ -51,6 +51,8 @@ static int irda_insert_integer(void *self, __u8 *buf, int len, __u8 pi, static int irda_insert_no_value(void *self, __u8 *buf, int len, __u8 pi, PV_TYPE type, PI_HANDLER func); +static int irda_param_unpack(__u8 *buf, char *fmt, ...); + /* Parameter value call table. Must match PV_TYPE */ static PV_HANDLER pv_extract_table[] = { irda_extract_integer, /* Handler for any length integers */ @@ -400,7 +402,7 @@ EXPORT_SYMBOL(irda_param_pack); /* * Function irda_param_unpack (skb, fmt, ...) */ -int irda_param_unpack(__u8 *buf, char *fmt, ...) +static int irda_param_unpack(__u8 *buf, char *fmt, ...) { irda_pv_t arg; va_list args; @@ -440,7 +442,6 @@ int irda_param_unpack(__u8 *buf, char *fmt, ...) return 0; } -EXPORT_SYMBOL(irda_param_unpack); /* * Function irda_param_insert (self, pi, buf, len, info) @@ -496,13 +497,14 @@ int irda_param_insert(void *self, __u8 pi, __u8 *buf, int len, EXPORT_SYMBOL(irda_param_insert); /* - * Function irda_param_extract_all (self, buf, len, info) + * Function irda_param_extract (self, buf, len, info) * * Parse all parameters. If len is correct, then everything should be * safe. Returns the number of bytes that was parsed * */ -int irda_param_extract(void *self, __u8 *buf, int len, pi_param_info_t *info) +static int irda_param_extract(void *self, __u8 *buf, int len, + pi_param_info_t *info) { pi_minor_info_t *pi_minor_info; __u8 pi_minor; @@ -549,7 +551,6 @@ int irda_param_extract(void *self, __u8 *buf, int len, pi_param_info_t *info) type, pi_minor_info->func); return ret; } -EXPORT_SYMBOL(irda_param_extract); /* * Function irda_param_extract_all (self, buf, len, info) diff --git a/net/irda/qos.c b/net/irda/qos.c index d37dd2548325..288d468a8fca 100644 --- a/net/irda/qos.c +++ b/net/irda/qos.c @@ -96,6 +96,10 @@ static int irlap_param_additional_bofs(void *instance, irda_param_t *parm, static int irlap_param_min_turn_time(void *instance, irda_param_t *param, int get); +#ifndef CONFIG_IRDA_DYNAMIC_WINDOW +static __u32 irlap_requested_line_capacity(struct qos_info *qos); +#endif + static __u32 min_turn_times[] = { 10000, 5000, 1000, 500, 100, 50, 10, 0 }; /* us */ static __u32 baud_rates[] = { 2400, 9600, 19200, 38400, 57600, 115200, 576000, 1152000, 4000000, 16000000 }; /* bps */ @@ -333,7 +337,7 @@ EXPORT_SYMBOL(irda_init_max_qos_capabilies); * Adjust QoS settings in case some values are not possible to use because * of other settings */ -void irlap_adjust_qos_settings(struct qos_info *qos) +static void irlap_adjust_qos_settings(struct qos_info *qos) { __u32 line_capacity; int index; @@ -723,19 +727,22 @@ __u32 irlap_max_line_capacity(__u32 speed, __u32 max_turn_time) return line_capacity; } -__u32 irlap_requested_line_capacity(struct qos_info *qos) -{ __u32 line_capacity; - - line_capacity = qos->window_size.value * +#ifndef CONFIG_IRDA_DYNAMIC_WINDOW +static __u32 irlap_requested_line_capacity(struct qos_info *qos) +{ + __u32 line_capacity; + + line_capacity = qos->window_size.value * (qos->data_size.value + 6 + qos->additional_bofs.value) + - irlap_min_turn_time_in_bytes(qos->baud_rate.value, + irlap_min_turn_time_in_bytes(qos->baud_rate.value, qos->min_turn_time.value); - + IRDA_DEBUG(2, "%s(), requested line capacity=%d\n", __FUNCTION__, line_capacity); - - return line_capacity; + + return line_capacity; } +#endif void irda_qos_bits_to_value(struct qos_info *qos) { -- cgit v1.2.3 From 821179bbae17583a190e7bca3ccdfa68c1904e3a Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 27 Dec 2004 04:46:42 -0800 Subject: [LLC]: Staticize and remove unnecessary functions and exports. The patch below contains the following possible cleanups: - make some needlessly global code static - remove the following unused global functions: - lc_c_ac.c: llc_conn_ac_report_status - lc_c_ac.c: llc_conn_ac_send_dm_rsp_f_set_f_flag - lc_c_ac.c: llc_conn_ac_resend_i_cmd_p_set_1 - lc_c_ac.c: llc_conn_ac_resend_i_cmd_p_set_1_or_send_rr - lc_c_ac.c: llc_conn_ac_send_ack_cmd_p_set_1 - lc_c_ac.c: llc_conn_ac_send_ua_rsp_f_set_f_flag - lc_c_ac.c: llc_conn_ac_set_f_flag_p - llc_c_ev.c: llc_conn_ev_conn_resp - llc_c_ev.c: llc_conn_ev_rst_resp - llc_c_ev.c: llc_conn_ev_rx_xxx_cmd_pbit_set_0 - llc_c_ev.c: llc_conn_ev_rx_xxx_yyy - llc_c_ev.c: llc_conn_ev_any_tmr_exp - llc_c_ev.c: llc_conn_ev_qlfy_init_p_f_cycle - llc_c_ev.c: llc_conn_ev_qlfy_set_status_impossible - llc_c_ev.c: llc_conn_ev_qlfy_set_status_received - llc_if.c: llc_build_and_send_reset_pkt - llc_pdu.c: llc_pdu_decode_cr_bit - remove the following unneeded EXPORT_SYMBOL: - llc_core.c: llc_sap_list_lock Signed-off-by: Adrian Bunk Signed-off-by: David S. Miller --- include/net/llc_c_ac.h | 19 -------- include/net/llc_c_ev.h | 12 ----- include/net/llc_conn.h | 3 -- include/net/llc_pdu.h | 1 - include/net/llc_sap.h | 1 - net/llc/llc_c_ac.c | 127 ++++++------------------------------------------- net/llc/llc_c_ev.c | 88 ---------------------------------- net/llc/llc_conn.c | 7 +-- net/llc/llc_core.c | 7 ++- net/llc/llc_if.c | 24 ---------- net/llc/llc_pdu.c | 13 ----- net/llc/llc_proc.c | 4 +- net/llc/llc_sap.c | 5 +- net/llc/llc_station.c | 2 +- 14 files changed, 27 insertions(+), 286 deletions(-) (limited to 'include') diff --git a/include/net/llc_c_ac.h b/include/net/llc_c_ac.h index 45f020aa69d5..df83f69d2de4 100644 --- a/include/net/llc_c_ac.h +++ b/include/net/llc_c_ac.h @@ -96,7 +96,6 @@ extern int llc_conn_ac_data_ind(struct sock* sk, struct sk_buff *skb); extern int llc_conn_ac_disc_ind(struct sock* sk, struct sk_buff *skb); extern int llc_conn_ac_rst_ind(struct sock* sk, struct sk_buff *skb); extern int llc_conn_ac_rst_confirm(struct sock* sk, struct sk_buff *skb); -extern int llc_conn_ac_report_status(struct sock* sk, struct sk_buff *skb); extern int llc_conn_ac_clear_remote_busy_if_f_eq_1(struct sock* sk, struct sk_buff *skb); extern int llc_conn_ac_stop_rej_tmr_if_data_flag_eq_2(struct sock* sk, @@ -107,8 +106,6 @@ extern int llc_conn_ac_send_dm_rsp_f_set_p(struct sock* sk, struct sk_buff *skb); extern int llc_conn_ac_send_dm_rsp_f_set_1(struct sock* sk, struct sk_buff *skb); -extern int llc_conn_ac_send_dm_rsp_f_set_f_flag(struct sock* sk, - struct sk_buff *skb); extern int llc_conn_ac_send_frmr_rsp_f_set_x(struct sock* sk, struct sk_buff *skb); extern int llc_conn_ac_resend_frmr_rsp_f_set_0(struct sock* sk, @@ -116,11 +113,6 @@ extern int llc_conn_ac_resend_frmr_rsp_f_set_0(struct sock* sk, extern int llc_conn_ac_resend_frmr_rsp_f_set_p(struct sock* sk, struct sk_buff *skb); extern int llc_conn_ac_send_i_cmd_p_set_1(struct sock* sk, struct sk_buff *skb); -extern int llc_conn_ac_send_i_cmd_p_set_0(struct sock* sk, struct sk_buff *skb); -extern int llc_conn_ac_resend_i_cmd_p_set_1(struct sock* sk, - struct sk_buff *skb); -extern int llc_conn_ac_resend_i_cmd_p_set_1_or_send_rr(struct sock* sk, - struct sk_buff *skb); extern int llc_conn_ac_send_i_xxx_x_set_0(struct sock* sk, struct sk_buff *skb); extern int llc_conn_ac_resend_i_xxx_x_set_0(struct sock* sk, struct sk_buff *skb); @@ -145,8 +137,6 @@ extern int llc_conn_ac_opt_send_rnr_xxx_x_set_0(struct sock* sk, struct sk_buff *skb); extern int llc_conn_ac_send_rr_cmd_p_set_1(struct sock* sk, struct sk_buff *skb); -extern int llc_conn_ac_send_ack_cmd_p_set_1(struct sock* sk, - struct sk_buff *skb); extern int llc_conn_ac_send_rr_rsp_f_set_1(struct sock* sk, struct sk_buff *skb); extern int llc_conn_ac_send_ack_rsp_f_set_1(struct sock* sk, @@ -157,8 +147,6 @@ extern int llc_conn_ac_send_ack_xxx_x_set_0(struct sock* sk, struct sk_buff *skb); extern int llc_conn_ac_send_sabme_cmd_p_set_x(struct sock* sk, struct sk_buff *skb); -extern int llc_conn_ac_send_ua_rsp_f_set_f_flag(struct sock* sk, - struct sk_buff *skb); extern int llc_conn_ac_send_ua_rsp_f_set_p(struct sock* sk, struct sk_buff *skb); extern int llc_conn_ac_set_s_flag_0(struct sock* sk, struct sk_buff *skb); @@ -183,7 +171,6 @@ extern int llc_conn_ac_set_data_flag_1(struct sock* sk, struct sk_buff *skb); extern int llc_conn_ac_set_data_flag_1_if_data_flag_eq_0(struct sock* sk, struct sk_buff *skb); extern int llc_conn_ac_set_p_flag_0(struct sock* sk, struct sk_buff *skb); -extern int llc_conn_ac_set_p_flag_1(struct sock* sk, struct sk_buff *skb); extern int llc_conn_ac_set_remote_busy_0(struct sock* sk, struct sk_buff *skb); extern int llc_conn_ac_set_retry_cnt_0(struct sock* sk, struct sk_buff *skb); extern int llc_conn_ac_set_cause_flag_0(struct sock* sk, struct sk_buff *skb); @@ -195,20 +182,14 @@ extern int llc_conn_ac_set_vs_0(struct sock* sk, struct sk_buff *skb); extern int llc_conn_ac_set_vs_nr(struct sock* sk, struct sk_buff *skb); extern int llc_conn_ac_rst_vs(struct sock* sk, struct sk_buff *skb); extern int llc_conn_ac_upd_vs(struct sock* sk, struct sk_buff *skb); -extern int llc_conn_ac_set_f_flag_p(struct sock* sk, struct sk_buff *skb); extern int llc_conn_disc(struct sock* sk, struct sk_buff *skb); extern int llc_conn_reset(struct sock* sk, struct sk_buff *skb); extern int llc_conn_ac_disc_confirm(struct sock* sk, struct sk_buff *skb); extern u8 llc_circular_between(u8 a, u8 b, u8 c); extern int llc_conn_ac_send_ack_if_needed(struct sock* sk, struct sk_buff *skb); -extern int llc_conn_ac_inc_npta_value(struct sock* sk, struct sk_buff *skb); extern int llc_conn_ac_adjust_npta_by_rr(struct sock* sk, struct sk_buff *skb); extern int llc_conn_ac_adjust_npta_by_rnr(struct sock* sk, struct sk_buff *skb); extern int llc_conn_ac_rst_sendack_flag(struct sock* sk, struct sk_buff *skb); -extern int llc_conn_ac_send_rr_rsp_f_set_ackpf(struct sock* sk, - struct sk_buff *skb); -extern int llc_conn_ac_send_i_rsp_f_set_ackpf(struct sock* sk, - struct sk_buff *skb); extern int llc_conn_ac_send_i_rsp_as_ack(struct sock* sk, struct sk_buff *skb); extern int llc_conn_ac_send_i_as_ack(struct sock* sk, struct sk_buff *skb); diff --git a/include/net/llc_c_ev.h b/include/net/llc_c_ev.h index 3deeb4235605..23a409381fa9 100644 --- a/include/net/llc_c_ev.h +++ b/include/net/llc_c_ev.h @@ -129,11 +129,9 @@ typedef int (*llc_conn_ev_t)(struct sock *sk, struct sk_buff *skb); typedef int (*llc_conn_ev_qfyr_t)(struct sock *sk, struct sk_buff *skb); extern int llc_conn_ev_conn_req(struct sock *sk, struct sk_buff *skb); -extern int llc_conn_ev_conn_resp(struct sock *sk, struct sk_buff *skb); extern int llc_conn_ev_data_req(struct sock *sk, struct sk_buff *skb); extern int llc_conn_ev_disc_req(struct sock *sk, struct sk_buff *skb); extern int llc_conn_ev_rst_req(struct sock *sk, struct sk_buff *skb); -extern int llc_conn_ev_rst_resp(struct sock *sk, struct sk_buff *skb); extern int llc_conn_ev_local_busy_detected(struct sock *sk, struct sk_buff *skb); extern int llc_conn_ev_local_busy_cleared(struct sock *sk, struct sk_buff *skb); @@ -162,7 +160,6 @@ extern int llc_conn_ev_rx_xxx_cmd_pbit_set_x(struct sock *sk, struct sk_buff *skb); extern int llc_conn_ev_rx_xxx_rsp_fbit_set_x(struct sock *sk, struct sk_buff *skb); -extern int llc_conn_ev_rx_xxx_yyy(struct sock *sk, struct sk_buff *skb); extern int llc_conn_ev_rx_zzz_cmd_pbit_set_x_inval_nr(struct sock *sk, struct sk_buff *skb); extern int llc_conn_ev_rx_zzz_rsp_fbit_set_x_inval_nr(struct sock *sk, @@ -171,13 +168,10 @@ extern int llc_conn_ev_p_tmr_exp(struct sock *sk, struct sk_buff *skb); extern int llc_conn_ev_ack_tmr_exp(struct sock *sk, struct sk_buff *skb); extern int llc_conn_ev_rej_tmr_exp(struct sock *sk, struct sk_buff *skb); extern int llc_conn_ev_busy_tmr_exp(struct sock *sk, struct sk_buff *skb); -extern int llc_conn_ev_any_tmr_exp(struct sock *sk, struct sk_buff *skb); extern int llc_conn_ev_sendack_tmr_exp(struct sock *sk, struct sk_buff *skb); /* NOT_USED functions and their variations */ extern int llc_conn_ev_rx_xxx_cmd_pbit_set_1(struct sock *sk, struct sk_buff *skb); -extern int llc_conn_ev_rx_xxx_cmd_pbit_set_0(struct sock *sk, - struct sk_buff *skb); extern int llc_conn_ev_rx_xxx_rsp_fbit_set_1(struct sock *sk, struct sk_buff *skb); extern int llc_conn_ev_rx_i_cmd_pbit_set_0_unexpd_ns(struct sock *sk, @@ -252,20 +246,14 @@ extern int llc_conn_ev_qlfy_cause_flag_eq_1(struct sock *sk, struct sk_buff *skb); extern int llc_conn_ev_qlfy_cause_flag_eq_0(struct sock *sk, struct sk_buff *skb); -extern int llc_conn_ev_qlfy_init_p_f_cycle(struct sock *sk, - struct sk_buff *skb); extern int llc_conn_ev_qlfy_set_status_conn(struct sock *sk, struct sk_buff *skb); extern int llc_conn_ev_qlfy_set_status_disc(struct sock *sk, struct sk_buff *skb); extern int llc_conn_ev_qlfy_set_status_failed(struct sock *sk, struct sk_buff *skb); -extern int llc_conn_ev_qlfy_set_status_impossible(struct sock *sk, - struct sk_buff *skb); extern int llc_conn_ev_qlfy_set_status_remote_busy(struct sock *sk, struct sk_buff *skb); -extern int llc_conn_ev_qlfy_set_status_received(struct sock *sk, - struct sk_buff *skb); extern int llc_conn_ev_qlfy_set_status_refuse(struct sock *sk, struct sk_buff *skb); extern int llc_conn_ev_qlfy_set_status_conflict(struct sock *sk, diff --git a/include/net/llc_conn.h b/include/net/llc_conn.h index 06fb01bccdbf..bbc0af5232ed 100644 --- a/include/net/llc_conn.h +++ b/include/net/llc_conn.h @@ -91,7 +91,6 @@ extern struct sock *llc_sk_alloc(int family, int priority); extern void llc_sk_free(struct sock *sk); extern void llc_sk_reset(struct sock *sk); -extern int llc_sk_init(struct sock *sk); /* Access to a connection */ extern int llc_conn_state_process(struct sock *sk, struct sk_buff *skb); @@ -106,8 +105,6 @@ extern int llc_conn_remove_acked_pdus(struct sock *conn, u8 nr, extern struct sock *llc_lookup_established(struct llc_sap *sap, struct llc_addr *daddr, struct llc_addr *laddr); -extern struct sock *llc_lookup_listener(struct llc_sap *sap, - struct llc_addr *laddr); extern void llc_sap_add_socket(struct llc_sap *sap, struct sock *sk); extern void llc_sap_remove_socket(struct llc_sap *sap, struct sock *sk); diff --git a/include/net/llc_pdu.h b/include/net/llc_pdu.h index cbbfc373447d..f45c37d89cf7 100644 --- a/include/net/llc_pdu.h +++ b/include/net/llc_pdu.h @@ -419,7 +419,6 @@ struct llc_frmr_info { extern void llc_pdu_set_cmd_rsp(struct sk_buff *skb, u8 type); extern void llc_pdu_set_pf_bit(struct sk_buff *skb, u8 bit_value); extern void llc_pdu_decode_pf_bit(struct sk_buff *skb, u8 *pf_bit); -extern void llc_pdu_decode_cr_bit(struct sk_buff *skb, u8 *cr_bit); extern void llc_pdu_init_as_disc_cmd(struct sk_buff *skb, u8 p_bit); extern void llc_pdu_init_as_i_cmd(struct sk_buff *skb, u8 p_bit, u8 ns, u8 nr); extern void llc_pdu_init_as_rej_cmd(struct sk_buff *skb, u8 p_bit, u8 nr); diff --git a/include/net/llc_sap.h b/include/net/llc_sap.h index dc60acce8e55..353baaa627f3 100644 --- a/include/net/llc_sap.h +++ b/include/net/llc_sap.h @@ -14,7 +14,6 @@ struct llc_sap; struct sk_buff; -extern void llc_sap_state_process(struct llc_sap *sap, struct sk_buff *skb); extern void llc_sap_rtn_pdu(struct llc_sap *sap, struct sk_buff *skb); extern void llc_save_primitive(struct sk_buff* skb, unsigned char prim); extern struct sk_buff *llc_alloc_frame(void); diff --git a/net/llc/llc_c_ac.c b/net/llc/llc_c_ac.c index f04f96fe5080..6d1eefaa10da 100644 --- a/net/llc/llc_c_ac.c +++ b/net/llc/llc_c_ac.c @@ -33,6 +33,13 @@ static int llc_conn_ac_inc_vs_by_1(struct sock *sk, struct sk_buff *skb); static void llc_process_tmr_ev(struct sock *sk, struct sk_buff *skb); static int llc_conn_ac_data_confirm(struct sock *sk, struct sk_buff *ev); +static int llc_conn_ac_inc_npta_value(struct sock *sk, struct sk_buff *skb); + +static int llc_conn_ac_send_rr_rsp_f_set_ackpf(struct sock *sk, + struct sk_buff *skb); + +static int llc_conn_ac_set_p_flag_1(struct sock *sk, struct sk_buff *skb); + #define INCORRECT 0 int llc_conn_ac_clear_remote_busy(struct sock *sk, struct sk_buff *skb) @@ -185,11 +192,6 @@ int llc_conn_ac_rst_confirm(struct sock *sk, struct sk_buff *skb) return 0; } -int llc_conn_ac_report_status(struct sock *sk, struct sk_buff *skb) -{ - return 0; -} - int llc_conn_ac_clear_remote_busy_if_f_eq_1(struct sock *sk, struct sk_buff *skb) { @@ -291,32 +293,6 @@ free: goto out; } -int llc_conn_ac_send_dm_rsp_f_set_f_flag(struct sock *sk, struct sk_buff *skb) -{ - int rc = -ENOBUFS; - struct sk_buff *nskb = llc_alloc_frame(); - - if (nskb) { - struct llc_opt *llc = llc_sk(sk); - struct llc_sap *sap = llc->sap; - u8 f_bit = llc->f_flag; - - nskb->dev = llc->dev; - llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, sap->laddr.lsap, - llc->daddr.lsap, LLC_PDU_RSP); - llc_pdu_init_as_dm_rsp(nskb, f_bit); - rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); - if (rc) - goto free; - llc_conn_send_pdu(sk, nskb); - } -out: - return rc; -free: - kfree_skb(nskb); - goto out; -} - int llc_conn_ac_send_frmr_rsp_f_set_x(struct sock *sk, struct sk_buff *skb) { u8 f_bit; @@ -426,7 +402,7 @@ int llc_conn_ac_send_i_cmd_p_set_1(struct sock *sk, struct sk_buff *skb) return rc; } -int llc_conn_ac_send_i_cmd_p_set_0(struct sock *sk, struct sk_buff *skb) +static int llc_conn_ac_send_i_cmd_p_set_0(struct sock *sk, struct sk_buff *skb) { int rc; struct llc_opt *llc = llc_sk(sk); @@ -443,27 +419,6 @@ int llc_conn_ac_send_i_cmd_p_set_0(struct sock *sk, struct sk_buff *skb) return rc; } -int llc_conn_ac_resend_i_cmd_p_set_1(struct sock *sk, struct sk_buff *skb) -{ - struct llc_pdu_sn *pdu = llc_pdu_sn_hdr(skb); - u8 nr = LLC_I_GET_NR(pdu); - - llc_conn_resend_i_pdu_as_cmd(sk, nr, 1); - return 0; -} - -int llc_conn_ac_resend_i_cmd_p_set_1_or_send_rr(struct sock *sk, - struct sk_buff *skb) -{ - struct llc_pdu_sn *pdu = llc_pdu_sn_hdr(skb); - u8 nr = LLC_I_GET_NR(pdu); - int rc = llc_conn_ac_send_rr_cmd_p_set_1(sk, skb); - - if (!rc) - llc_conn_resend_i_pdu_as_cmd(sk, nr, 0); - return rc; -} - int llc_conn_ac_send_i_xxx_x_set_0(struct sock *sk, struct sk_buff *skb) { int rc; @@ -745,31 +700,6 @@ free: goto out; } -int llc_conn_ac_send_ack_cmd_p_set_1(struct sock *sk, struct sk_buff *skb) -{ - int rc = -ENOBUFS; - struct sk_buff *nskb = llc_alloc_frame(); - - if (nskb) { - struct llc_opt *llc = llc_sk(sk); - struct llc_sap *sap = llc->sap; - - nskb->dev = llc->dev; - llc_pdu_header_init(nskb, LLC_PDU_TYPE_S, sap->laddr.lsap, - llc->daddr.lsap, LLC_PDU_CMD); - llc_pdu_init_as_rr_cmd(nskb, 1, llc->vR); - rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); - if (rc) - goto free; - llc_conn_send_pdu(sk, nskb); - } -out: - return rc; -free: - kfree_skb(nskb); - goto out; -} - int llc_conn_ac_send_rr_rsp_f_set_1(struct sock *sk, struct sk_buff *skb) { int rc = -ENOBUFS; @@ -911,31 +841,6 @@ free: goto out; } -int llc_conn_ac_send_ua_rsp_f_set_f_flag(struct sock *sk, struct sk_buff *skb) -{ - int rc = -ENOBUFS; - struct sk_buff *nskb = llc_alloc_frame(); - - if (nskb) { - struct llc_opt *llc = llc_sk(sk); - struct llc_sap *sap = llc->sap; - - nskb->dev = llc->dev; - llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, sap->laddr.lsap, - llc->daddr.lsap, LLC_PDU_RSP); - llc_pdu_init_as_ua_rsp(nskb, llc->f_flag); - rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac); - if (rc) - goto free; - llc_conn_send_pdu(sk, nskb); - } -out: - return rc; -free: - kfree_skb(nskb); - goto out; -} - int llc_conn_ac_send_ua_rsp_f_set_p(struct sock *sk, struct sk_buff *skb) { u8 f_bit; @@ -1041,7 +946,8 @@ int llc_conn_ac_rst_sendack_flag(struct sock *sk, struct sk_buff *skb) * set to one if one PDU with p-bit set to one is received. Returns 0 for * success, 1 otherwise. */ -int llc_conn_ac_send_i_rsp_f_set_ackpf(struct sock *sk, struct sk_buff *skb) +static int llc_conn_ac_send_i_rsp_f_set_ackpf(struct sock *sk, + struct sk_buff *skb) { int rc; struct llc_opt *llc = llc_sk(sk); @@ -1091,7 +997,8 @@ int llc_conn_ac_send_i_as_ack(struct sock *sk, struct sk_buff *skb) * if there is any. ack_pf flag indicates if a PDU has been received with * p-bit set to one. Returns 0 for success, 1 otherwise. */ -int llc_conn_ac_send_rr_rsp_f_set_ackpf(struct sock *sk, struct sk_buff *skb) +static int llc_conn_ac_send_rr_rsp_f_set_ackpf(struct sock *sk, + struct sk_buff *skb) { int rc = -ENOBUFS; struct sk_buff *nskb = llc_alloc_frame(); @@ -1126,7 +1033,7 @@ free: * acknowledgements decreases by increasing of "npta". Returns 0 for * success, 1 otherwise. */ -int llc_conn_ac_inc_npta_value(struct sock *sk, struct sk_buff *skb) +static int llc_conn_ac_inc_npta_value(struct sock *sk, struct sk_buff *skb) { struct llc_opt *llc = llc_sk(sk); @@ -1387,7 +1294,7 @@ int llc_conn_ac_set_p_flag_0(struct sock *sk, struct sk_buff *skb) return 0; } -int llc_conn_ac_set_p_flag_1(struct sock *sk, struct sk_buff *skb) +static int llc_conn_ac_set_p_flag_1(struct sock *sk, struct sk_buff *skb) { llc_conn_set_p_flag(sk, 1); return 0; @@ -1453,12 +1360,6 @@ int llc_conn_ac_inc_vs_by_1(struct sock *sk, struct sk_buff *skb) return 0; } -int llc_conn_ac_set_f_flag_p(struct sock *sk, struct sk_buff *skb) -{ - llc_pdu_decode_pf_bit(skb, &llc_sk(sk)->f_flag); - return 0; -} - void llc_conn_pf_cycle_tmr_cb(unsigned long timeout_data) { struct sock *sk = (struct sock *)timeout_data; diff --git a/net/llc/llc_c_ev.c b/net/llc/llc_c_ev.c index 77d630de2186..c7ed6c76cef3 100644 --- a/net/llc/llc_c_ev.c +++ b/net/llc/llc_c_ev.c @@ -105,14 +105,6 @@ int llc_conn_ev_conn_req(struct sock *sk, struct sk_buff *skb) ev->prim_type == LLC_PRIM_TYPE_REQ ? 0 : 1; } -int llc_conn_ev_conn_resp(struct sock *sk, struct sk_buff *skb) -{ - struct llc_conn_state_ev *ev = llc_conn_ev(skb); - - return ev->prim == LLC_CONN_PRIM && - ev->prim_type == LLC_PRIM_TYPE_RESP ? 0 : 1; -} - int llc_conn_ev_data_req(struct sock *sk, struct sk_buff *skb) { struct llc_conn_state_ev *ev = llc_conn_ev(skb); @@ -137,14 +129,6 @@ int llc_conn_ev_rst_req(struct sock *sk, struct sk_buff *skb) ev->prim_type == LLC_PRIM_TYPE_REQ ? 0 : 1; } -int llc_conn_ev_rst_resp(struct sock *sk, struct sk_buff *skb) -{ - struct llc_conn_state_ev *ev = llc_conn_ev(skb); - - return ev->prim == LLC_RESET_PRIM && - ev->prim_type == LLC_PRIM_TYPE_RESP ? 0 : 1; -} - int llc_conn_ev_local_busy_detected(struct sock *sk, struct sk_buff *skb) { struct llc_conn_state_ev *ev = llc_conn_ev(skb); @@ -474,27 +458,6 @@ int llc_conn_ev_rx_xxx_cmd_pbit_set_1(struct sock *sk, struct sk_buff *skb) return rc; } -int llc_conn_ev_rx_xxx_cmd_pbit_set_0(struct sock *sk, struct sk_buff *skb) -{ - u16 rc = 1; - struct llc_pdu_sn *pdu = llc_pdu_sn_hdr(skb); - - if (LLC_PDU_IS_CMD(pdu)) { - if (LLC_PDU_TYPE_IS_I(pdu) || LLC_PDU_TYPE_IS_S(pdu)) { - if (LLC_I_PF_IS_0(pdu)) - rc = 0; - } else if (LLC_PDU_TYPE_IS_U(pdu)) - switch (LLC_U_PDU_CMD(pdu)) { - case LLC_2_PDU_CMD_SABME: - case LLC_2_PDU_CMD_DISC: - if (LLC_U_PF_IS_0(pdu)) - rc = 0; - break; - } - } - return rc; -} - int llc_conn_ev_rx_xxx_cmd_pbit_set_x(struct sock *sk, struct sk_buff *skb) { u16 rc = 1; @@ -557,26 +520,6 @@ int llc_conn_ev_rx_xxx_rsp_fbit_set_x(struct sock *sk, struct sk_buff *skb) return rc; } -int llc_conn_ev_rx_xxx_yyy(struct sock *sk, struct sk_buff *skb) -{ - u16 rc = 1; - struct llc_pdu_un *pdu = llc_pdu_un_hdr(skb); - - if (LLC_PDU_TYPE_IS_I(pdu) || LLC_PDU_TYPE_IS_S(pdu)) - rc = 0; - else if (LLC_PDU_TYPE_IS_U(pdu)) - switch (LLC_U_PDU_CMD(pdu)) { - case LLC_2_PDU_CMD_SABME: - case LLC_2_PDU_CMD_DISC: - case LLC_2_PDU_RSP_UA: - case LLC_2_PDU_RSP_DM: - case LLC_2_PDU_RSP_FRMR: - rc = 0; - break; - } - return rc; -} - int llc_conn_ev_rx_zzz_cmd_pbit_set_x_inval_nr(struct sock *sk, struct sk_buff *skb) { @@ -646,16 +589,6 @@ int llc_conn_ev_busy_tmr_exp(struct sock *sk, struct sk_buff *skb) return ev->type != LLC_CONN_EV_TYPE_BUSY_TMR; } -int llc_conn_ev_any_tmr_exp(struct sock *sk, struct sk_buff *skb) -{ - struct llc_conn_state_ev *ev = llc_conn_ev(skb); - - return ev->type == LLC_CONN_EV_TYPE_P_TMR || - ev->type == LLC_CONN_EV_TYPE_ACK_TMR || - ev->type == LLC_CONN_EV_TYPE_REJ_TMR || - ev->type == LLC_CONN_EV_TYPE_BUSY_TMR ? 0 : 1; -} - int llc_conn_ev_init_p_f_cycle(struct sock *sk, struct sk_buff *skb) { return 1; @@ -778,11 +711,6 @@ int llc_conn_ev_qlfy_cause_flag_eq_0(struct sock *sk, struct sk_buff *skb) return llc_sk(sk)->cause_flag; } -int llc_conn_ev_qlfy_init_p_f_cycle(struct sock *sk, struct sk_buff *skb) -{ - return 0; -} - int llc_conn_ev_qlfy_set_status_conn(struct sock *sk, struct sk_buff *skb) { struct llc_conn_state_ev *ev = llc_conn_ev(skb); @@ -799,14 +727,6 @@ int llc_conn_ev_qlfy_set_status_disc(struct sock *sk, struct sk_buff *skb) return 0; } -int llc_conn_ev_qlfy_set_status_impossible(struct sock *sk, struct sk_buff *skb) -{ - struct llc_conn_state_ev *ev = llc_conn_ev(skb); - - ev->status = LLC_STATUS_IMPOSSIBLE; - return 0; -} - int llc_conn_ev_qlfy_set_status_failed(struct sock *sk, struct sk_buff *skb) { struct llc_conn_state_ev *ev = llc_conn_ev(skb); @@ -824,14 +744,6 @@ int llc_conn_ev_qlfy_set_status_remote_busy(struct sock *sk, return 0; } -int llc_conn_ev_qlfy_set_status_received(struct sock *sk, struct sk_buff *skb) -{ - struct llc_conn_state_ev *ev = llc_conn_ev(skb); - - ev->status = LLC_STATUS_RECEIVED; - return 0; -} - int llc_conn_ev_qlfy_set_status_refuse(struct sock *sk, struct sk_buff *skb) { struct llc_conn_state_ev *ev = llc_conn_ev(skb); diff --git a/net/llc/llc_conn.c b/net/llc/llc_conn.c index 075364466ac1..9dd0f26a1534 100644 --- a/net/llc/llc_conn.c +++ b/net/llc/llc_conn.c @@ -503,7 +503,8 @@ found: * local mac, and local sap. Returns pointer for parent socket found, * %NULL otherwise. */ -struct sock *llc_lookup_listener(struct llc_sap *sap, struct llc_addr *laddr) +static struct sock *llc_lookup_listener(struct llc_sap *sap, + struct llc_addr *laddr) { struct sock *rc; struct hlist_node *node; @@ -546,7 +547,7 @@ u8 llc_data_accept_state(u8 state) * Finds offset of next category of transitions in transition table. * Returns the start index of next category. */ -u16 find_next_offset(struct llc_conn_state *state, u16 offset) +static u16 find_next_offset(struct llc_conn_state *state, u16 offset) { u16 cnt = 0; struct llc_conn_state_trans **next_trans; @@ -785,7 +786,7 @@ out_kfree_skb: * * Initializes a socket with default llc values. */ -int llc_sk_init(struct sock* sk) +static int llc_sk_init(struct sock* sk) { struct llc_opt *llc = kmalloc(sizeof(*llc), GFP_ATOMIC); int rc = -ENOMEM; diff --git a/net/llc/llc_core.c b/net/llc/llc_core.c index e1140375e665..a2c30b8fb7e6 100644 --- a/net/llc/llc_core.c +++ b/net/llc/llc_core.c @@ -31,7 +31,7 @@ unsigned char llc_station_mac_sa[ETH_ALEN]; * * Allocates and initializes sap. */ -struct llc_sap *llc_sap_alloc(void) +static struct llc_sap *llc_sap_alloc(void) { struct llc_sap *sap = kmalloc(sizeof(*sap), GFP_ATOMIC); @@ -50,7 +50,7 @@ struct llc_sap *llc_sap_alloc(void) * * Adds a sap to the LLC's station sap list. */ -void llc_add_sap(struct llc_sap *sap) +static void llc_add_sap(struct llc_sap *sap) { write_lock_bh(&llc_sap_list_lock); list_add_tail(&sap->node, &llc_sap_list); @@ -63,7 +63,7 @@ void llc_add_sap(struct llc_sap *sap) * * Removes a sap to the LLC's station sap list. */ -void llc_del_sap(struct llc_sap *sap) +static void llc_del_sap(struct llc_sap *sap) { write_lock_bh(&llc_sap_list_lock); list_del(&sap->node); @@ -169,7 +169,6 @@ module_exit(llc_exit); EXPORT_SYMBOL(llc_station_mac_sa); EXPORT_SYMBOL(llc_sap_list); -EXPORT_SYMBOL(llc_sap_list_lock); EXPORT_SYMBOL(llc_sap_find); EXPORT_SYMBOL(llc_sap_open); EXPORT_SYMBOL(llc_sap_close); diff --git a/net/llc/llc_if.c b/net/llc/llc_if.c index 31253d2a3bc9..5949147018af 100644 --- a/net/llc/llc_if.c +++ b/net/llc/llc_if.c @@ -155,27 +155,3 @@ out: return rc; } -/** - * llc_build_and_send_reset_pkt - Resets an established LLC connection - * @prim: pointer to structure that contains service parameters. - * - * Called when upper layer wants to reset an established LLC connection - * with a remote machine. This function packages a proper event and sends - * it to connection component state machine. Returns 0 for success, 1 - * otherwise. - */ -int llc_build_and_send_reset_pkt(struct sock *sk) -{ - int rc = 1; - struct sk_buff *skb = alloc_skb(0, GFP_ATOMIC); - - if (skb) { - struct llc_conn_state_ev *ev = llc_conn_ev(skb); - - ev->type = LLC_CONN_EV_TYPE_PRIM; - ev->prim = LLC_RESET_PRIM; - ev->prim_type = LLC_PRIM_TYPE_REQ; - rc = llc_conn_state_process(sk, skb); - } - return rc; -} diff --git a/net/llc/llc_pdu.c b/net/llc/llc_pdu.c index 66344fabd84d..a28ce525d201 100644 --- a/net/llc/llc_pdu.c +++ b/net/llc/llc_pdu.c @@ -79,19 +79,6 @@ void llc_pdu_decode_pf_bit(struct sk_buff *skb, u8 *pf_bit) } } -/** - * llc_pdu_decode_cr_bit - extracts command response bit from LLC header - * @skb: input skb that c/r bit must be extracted from it. - * @cr_bit: command/response bit (0 or 1). - * - * This function extracts command/response bit from LLC header. this bit - * is right bit of source SAP. - */ -void llc_pdu_decode_cr_bit(struct sk_buff *skb, u8 *cr_bit) -{ - *cr_bit = llc_pdu_un_hdr(skb)->ssap & LLC_PDU_CMD_RSP_MASK; -} - /** * llc_pdu_init_as_disc_cmd - Builds DISC PDU * @skb: Address of the skb to build diff --git a/net/llc/llc_proc.c b/net/llc/llc_proc.c index a991727b366a..c7de46e5cea4 100644 --- a/net/llc/llc_proc.c +++ b/net/llc/llc_proc.c @@ -185,14 +185,14 @@ out: return 0; } -struct seq_operations llc_seq_socket_ops = { +static struct seq_operations llc_seq_socket_ops = { .start = llc_seq_start, .next = llc_seq_next, .stop = llc_seq_stop, .show = llc_seq_socket_show, }; -struct seq_operations llc_seq_core_ops = { +static struct seq_operations llc_seq_core_ops = { .start = llc_seq_start, .next = llc_seq_next, .stop = llc_seq_stop, diff --git a/net/llc/llc_sap.c b/net/llc/llc_sap.c index 0d42af0f6352..89ca222cfba5 100644 --- a/net/llc/llc_sap.c +++ b/net/llc/llc_sap.c @@ -173,7 +173,7 @@ out: * if needed(on receiving an UI frame). sk can be null for the * datalink_proto case. */ -void llc_sap_state_process(struct llc_sap *sap, struct sk_buff *skb) +static void llc_sap_state_process(struct llc_sap *sap, struct sk_buff *skb) { struct llc_sap_state_ev *ev = llc_sap_ev(skb); @@ -275,7 +275,8 @@ static void llc_sap_rcv(struct llc_sap *sap, struct sk_buff *skb) * Search socket list of the SAP and finds connection using the local * mac, and local sap. Returns pointer for socket found, %NULL otherwise. */ -struct sock *llc_lookup_dgram(struct llc_sap *sap, struct llc_addr *laddr) +static struct sock *llc_lookup_dgram(struct llc_sap *sap, + struct llc_addr *laddr) { struct sock *rc; struct hlist_node *node; diff --git a/net/llc/llc_station.c b/net/llc/llc_station.c index 76177cdcf591..8fe48a24bad5 100644 --- a/net/llc/llc_station.c +++ b/net/llc/llc_station.c @@ -642,7 +642,7 @@ static void llc_station_service_events(void) * Queues an event (on the station event queue) for handling by the * station state machine and attempts to process any queued-up events. */ -void llc_station_state_process(struct sk_buff *skb) +static void llc_station_state_process(struct sk_buff *skb) { spin_lock_bh(&llc_main_station.ev_q.lock); skb_queue_tail(&llc_main_station.ev_q.list, skb); -- cgit v1.2.3 From 1ebb100cb0140f6cfc3a3a4cb5b3de43cc41e9c9 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 27 Dec 2004 04:49:18 -0800 Subject: [ROSE]: Staticize and remove unused global functions. Signed-off-by: Adrian Bunk Signed-off-by: David S. Miller --- include/net/rose.h | 8 -------- net/rose/af_rose.c | 2 +- net/rose/rose_dev.c | 32 -------------------------------- net/rose/rose_link.c | 39 +++++++-------------------------------- net/rose/rose_route.c | 4 ++-- net/rose/rose_subr.c | 4 +++- 6 files changed, 13 insertions(+), 76 deletions(-) (limited to 'include') diff --git a/include/net/rose.h b/include/net/rose.h index f3382358e5ee..32fb79817d31 100644 --- a/include/net/rose.h +++ b/include/net/rose.h @@ -162,7 +162,6 @@ extern int rose_rx_call_request(struct sk_buff *, struct net_device *, struct r extern void rose_destroy_socket(struct sock *); /* rose_dev.c */ -extern int rose_rx_ip(struct sk_buff *, struct net_device *); extern void rose_setup(struct net_device *); /* rose_in.c */ @@ -170,15 +169,10 @@ extern int rose_process_rx_frame(struct sock *, struct sk_buff *); /* rose_link.c */ extern void rose_start_ftimer(struct rose_neigh *); -extern void rose_start_t0timer(struct rose_neigh *); extern void rose_stop_ftimer(struct rose_neigh *); extern void rose_stop_t0timer(struct rose_neigh *); extern int rose_ftimer_running(struct rose_neigh *); -extern int rose_t0timer_running(struct rose_neigh *); extern void rose_link_rx_restart(struct sk_buff *, struct rose_neigh *, unsigned short); -extern void rose_transmit_restart_request(struct rose_neigh *); -extern void rose_transmit_restart_confirmation(struct rose_neigh *); -extern void rose_transmit_diagnostic(struct rose_neigh *, unsigned char); extern void rose_transmit_clear_request(struct rose_neigh *, unsigned int, unsigned char, unsigned char); extern void rose_transmit_link(struct sk_buff *, struct rose_neigh *); @@ -205,7 +199,6 @@ extern void rose_link_device_down(struct net_device *); extern struct net_device *rose_dev_first(void); extern struct net_device *rose_dev_get(rose_address *); extern struct rose_route *rose_route_free_lci(unsigned int, struct rose_neigh *); -extern struct net_device *rose_ax25_dev_get(char *); extern struct rose_neigh *rose_get_neigh(rose_address *, unsigned char *, unsigned char *); extern int rose_rt_ioctl(unsigned int, void __user *); extern void rose_link_failed(ax25_cb *, int); @@ -220,7 +213,6 @@ extern int rose_validate_nr(struct sock *, unsigned short); extern void rose_write_internal(struct sock *, int); extern int rose_decode(struct sk_buff *, int *, int *, int *, int *, int *); extern int rose_parse_facilities(unsigned char *, struct rose_facilities_struct *); -extern int rose_create_facilities(unsigned char *, rose_cb *); extern void rose_disconnect(struct sock *, int, int, int); /* rose_timer.c */ diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index 4f6a9fab4e54..3d26b72b2b3a 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c @@ -59,7 +59,7 @@ int sysctl_rose_maximum_vcs = ROSE_DEFAULT_MAXVC; int sysctl_rose_window_size = ROSE_DEFAULT_WINDOW_SIZE; static HLIST_HEAD(rose_list); -spinlock_t rose_list_lock = SPIN_LOCK_UNLOCKED; +static spinlock_t rose_list_lock = SPIN_LOCK_UNLOCKED; static struct proto_ops rose_proto_ops; diff --git a/net/rose/rose_dev.c b/net/rose/rose_dev.c index d779e071b97d..98001cc84a2c 100644 --- a/net/rose/rose_dev.c +++ b/net/rose/rose_dev.c @@ -37,38 +37,6 @@ #include #include -/* - * Only allow IP over ROSE frames through if the netrom device is up. - */ - -int rose_rx_ip(struct sk_buff *skb, struct net_device *dev) -{ - struct net_device_stats *stats = (struct net_device_stats *)dev->priv; - -#ifdef CONFIG_INET - if (!netif_running(dev)) { - stats->rx_errors++; - return 0; - } - - stats->rx_packets++; - stats->rx_bytes += skb->len; - - skb->protocol = htons(ETH_P_IP); - - /* Spoof incoming device */ - skb->dev = dev; - skb->h.raw = skb->data; - skb->nh.raw = skb->data; - skb->pkt_type = PACKET_HOST; - - ip_rcv(skb, skb->dev, NULL); -#else - kfree_skb(skb); -#endif - return 1; -} - static int rose_header(struct sk_buff *skb, struct net_device *dev, unsigned short type, void *daddr, void *saddr, unsigned len) { diff --git a/net/rose/rose_link.c b/net/rose/rose_link.c index 8974778d70d7..09e9e9d04d92 100644 --- a/net/rose/rose_link.c +++ b/net/rose/rose_link.c @@ -31,6 +31,9 @@ static void rose_ftimer_expiry(unsigned long); static void rose_t0timer_expiry(unsigned long); +static void rose_transmit_restart_confirmation(struct rose_neigh *neigh); +static void rose_transmit_restart_request(struct rose_neigh *neigh); + void rose_start_ftimer(struct rose_neigh *neigh) { del_timer(&neigh->ftimer); @@ -42,7 +45,7 @@ void rose_start_ftimer(struct rose_neigh *neigh) add_timer(&neigh->ftimer); } -void rose_start_t0timer(struct rose_neigh *neigh) +static void rose_start_t0timer(struct rose_neigh *neigh) { del_timer(&neigh->t0timer); @@ -68,7 +71,7 @@ int rose_ftimer_running(struct rose_neigh *neigh) return timer_pending(&neigh->ftimer); } -int rose_t0timer_running(struct rose_neigh *neigh) +static int rose_t0timer_running(struct rose_neigh *neigh) { return timer_pending(&neigh->t0timer); } @@ -165,7 +168,7 @@ void rose_link_rx_restart(struct sk_buff *skb, struct rose_neigh *neigh, unsigne /* * This routine is called when a Restart Request is needed */ -void rose_transmit_restart_request(struct rose_neigh *neigh) +static void rose_transmit_restart_request(struct rose_neigh *neigh) { struct sk_buff *skb; unsigned char *dptr; @@ -194,7 +197,7 @@ void rose_transmit_restart_request(struct rose_neigh *neigh) /* * This routine is called when a Restart Confirmation is needed */ -void rose_transmit_restart_confirmation(struct rose_neigh *neigh) +static void rose_transmit_restart_confirmation(struct rose_neigh *neigh) { struct sk_buff *skb; unsigned char *dptr; @@ -218,34 +221,6 @@ void rose_transmit_restart_confirmation(struct rose_neigh *neigh) kfree_skb(skb); } -/* - * This routine is called when a Diagnostic is required. - */ -void rose_transmit_diagnostic(struct rose_neigh *neigh, unsigned char diag) -{ - struct sk_buff *skb; - unsigned char *dptr; - int len; - - len = AX25_BPQ_HEADER_LEN + AX25_MAX_HEADER_LEN + ROSE_MIN_LEN + 2; - - if ((skb = alloc_skb(len, GFP_ATOMIC)) == NULL) - return; - - skb_reserve(skb, AX25_BPQ_HEADER_LEN + AX25_MAX_HEADER_LEN); - - dptr = skb_put(skb, ROSE_MIN_LEN + 2); - - *dptr++ = AX25_P_ROSE; - *dptr++ = ROSE_GFI; - *dptr++ = 0x00; - *dptr++ = ROSE_DIAGNOSTIC; - *dptr++ = diag; - - if (!rose_send_frame(skb, neigh)) - kfree_skb(skb); -} - /* * This routine is called when a Clear Request is needed outside of the context * of a connected socket. diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c index eb0de0c2dc95..35591a0486cc 100644 --- a/net/rose/rose_route.c +++ b/net/rose/rose_route.c @@ -41,7 +41,7 @@ static unsigned int rose_neigh_no = 1; static struct rose_node *rose_node_list; static spinlock_t rose_node_list_lock = SPIN_LOCK_UNLOCKED; -struct rose_neigh *rose_neigh_list; +static struct rose_neigh *rose_neigh_list; static spinlock_t rose_neigh_list_lock = SPIN_LOCK_UNLOCKED; static struct rose_route *rose_route_list; static spinlock_t rose_route_list_lock = SPIN_LOCK_UNLOCKED; @@ -587,7 +587,7 @@ static int rose_clear_routes(void) /* * Check that the device given is a valid AX.25 interface that is "up". */ -struct net_device *rose_ax25_dev_get(char *devname) +static struct net_device *rose_ax25_dev_get(char *devname) { struct net_device *dev; diff --git a/net/rose/rose_subr.c b/net/rose/rose_subr.c index 4c3f3c7f08a8..e2cd9d8c9b5b 100644 --- a/net/rose/rose_subr.c +++ b/net/rose/rose_subr.c @@ -28,6 +28,8 @@ #include #include +static int rose_create_facilities(unsigned char *buffer, rose_cb *rose); + /* * This routine purges all of the queues of frames. */ @@ -394,7 +396,7 @@ int rose_parse_facilities(unsigned char *p, return 1; } -int rose_create_facilities(unsigned char *buffer, rose_cb *rose) +static int rose_create_facilities(unsigned char *buffer, rose_cb *rose) { unsigned char *p = buffer + 1; char *callsign; -- cgit v1.2.3 From 6c94b148ebe13dd9bca5829ee76dcd74ab12996c Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 27 Dec 2004 04:50:34 -0800 Subject: [RXRPC]: Staticize and remove unused globals and exports. The patch below contains the following possible cleanups: - make some needlessly global code static - remove the following unused global function: - transport.c: rxrpc_clear_transport - remove the following unneeded EXPORT_SYMBOL: - rxrpc_syms.c: rxrpc_call_flush Signed-off-by: Adrian Bunk Signed-off-by: David S. Miller --- include/rxrpc/call.h | 5 ----- include/rxrpc/packet.h | 2 -- include/rxrpc/transport.h | 2 -- net/rxrpc/call.c | 15 +++++++++------ net/rxrpc/connection.c | 4 +++- net/rxrpc/internal.h | 3 --- net/rxrpc/peer.c | 4 +++- net/rxrpc/rxrpc_syms.c | 1 - net/rxrpc/transport.c | 10 ---------- 9 files changed, 15 insertions(+), 31 deletions(-) (limited to 'include') diff --git a/include/rxrpc/call.h b/include/rxrpc/call.h index f9b0a7cbd0a3..f48f27e9e0ab 100644 --- a/include/rxrpc/call.h +++ b/include/rxrpc/call.h @@ -20,9 +20,6 @@ #define RXRPC_CALL_ACK_WINDOW_SIZE 16 extern unsigned rxrpc_call_rcv_timeout; /* receive activity timeout (secs) */ -extern unsigned rxrpc_call_acks_timeout; /* pending ACK (retransmit) timeout (secs) */ -extern unsigned rxrpc_call_dfr_ack_timeout; /* deferred ACK timeout (secs) */ -extern unsigned short rxrpc_call_max_resend; /* maximum consecutive resend count */ /* application call state * - only state 0 and ffff are reserved, the state is set to 1 after an opid is received @@ -210,8 +207,6 @@ extern int rxrpc_call_write_data(struct rxrpc_call *call, int dup_data, size_t *size_sent); -extern int rxrpc_call_flush(struct rxrpc_call *call); - extern void rxrpc_call_handle_error(struct rxrpc_call *conn, int local, int errno); #endif /* _LINUX_RXRPC_CALL_H */ diff --git a/include/rxrpc/packet.h b/include/rxrpc/packet.h index f9224d3635be..1447f0aaa0eb 100644 --- a/include/rxrpc/packet.h +++ b/include/rxrpc/packet.h @@ -124,6 +124,4 @@ struct rxrpc_ackpacket } __attribute__((packed)); -extern const char *rxrpc_acks[]; - #endif /* _LINUX_RXRPC_PACKET_H */ diff --git a/include/rxrpc/transport.h b/include/rxrpc/transport.h index 486371459550..7c7b9683fa39 100644 --- a/include/rxrpc/transport.h +++ b/include/rxrpc/transport.h @@ -103,6 +103,4 @@ extern int rxrpc_trans_immediate_abort(struct rxrpc_transport *trans, struct rxrpc_message *msg, int error); -extern void rxrpc_clear_transport(struct rxrpc_transport *trans); - #endif /* _LINUX_RXRPC_TRANSPORT_H */ diff --git a/net/rxrpc/call.c b/net/rxrpc/call.c index dfb65d87ff87..5cfd4cadee42 100644 --- a/net/rxrpc/call.c +++ b/net/rxrpc/call.c @@ -26,10 +26,10 @@ __RXACCT_DECL(atomic_t rxrpc_message_count); LIST_HEAD(rxrpc_calls); DECLARE_RWSEM(rxrpc_calls_sem); -unsigned rxrpc_call_rcv_timeout = HZ/3; -unsigned rxrpc_call_acks_timeout = HZ/3; -unsigned rxrpc_call_dfr_ack_timeout = HZ/20; -unsigned short rxrpc_call_max_resend = HZ/10; +unsigned rxrpc_call_rcv_timeout = HZ/3; +static unsigned rxrpc_call_acks_timeout = HZ/3; +static unsigned rxrpc_call_dfr_ack_timeout = HZ/20; +static unsigned short rxrpc_call_max_resend = HZ/10; const char *rxrpc_call_states[] = { "COMPLETE", @@ -58,7 +58,7 @@ const char *rxrpc_pkts[] = { "?09", "?10", "?11", "?12", "?13", "?14", "?15" }; -const char *rxrpc_acks[] = { +static const char *rxrpc_acks[] = { "---", "REQ", "DUP", "SEQ", "WIN", "MEM", "PNG", "PNR", "DLY", "IDL", "-?-" }; @@ -79,6 +79,9 @@ static int rxrpc_call_record_ACK(struct rxrpc_call *call, struct rxrpc_message *msg, rxrpc_seq_t seq, size_t count); + +static int rxrpc_call_flush(struct rxrpc_call *call); + #define _state(call) \ _debug("[[[ state %s ]]]", rxrpc_call_states[call->app_call_state]); @@ -2079,7 +2082,7 @@ int rxrpc_call_write_data(struct rxrpc_call *call, /* * flush outstanding packets to the network */ -int rxrpc_call_flush(struct rxrpc_call *call) +static int rxrpc_call_flush(struct rxrpc_call *call) { struct rxrpc_message *msg; int ret = 0; diff --git a/net/rxrpc/connection.c b/net/rxrpc/connection.c index a978007bff4d..61463c74f8cc 100644 --- a/net/rxrpc/connection.c +++ b/net/rxrpc/connection.c @@ -30,6 +30,8 @@ LIST_HEAD(rxrpc_conns); DECLARE_RWSEM(rxrpc_conns_sem); unsigned long rxrpc_conn_timeout = 60 * 60; +static void rxrpc_conn_do_timeout(struct rxrpc_connection *conn); + static void __rxrpc_conn_timeout(rxrpc_timer_t *timer) { struct rxrpc_connection *conn = @@ -415,7 +417,7 @@ void rxrpc_put_connection(struct rxrpc_connection *conn) /* * free a connection record */ -void rxrpc_conn_do_timeout(struct rxrpc_connection *conn) +static void rxrpc_conn_do_timeout(struct rxrpc_connection *conn) { struct rxrpc_peer *peer; diff --git a/net/rxrpc/internal.h b/net/rxrpc/internal.h index 752b6d71d017..70e52f6b0b64 100644 --- a/net/rxrpc/internal.h +++ b/net/rxrpc/internal.h @@ -73,7 +73,6 @@ extern struct list_head rxrpc_conns; extern struct rw_semaphore rxrpc_conns_sem; extern unsigned long rxrpc_conn_timeout; -extern void rxrpc_conn_do_timeout(struct rxrpc_connection *conn); extern void rxrpc_conn_clearall(struct rxrpc_peer *peer); /* @@ -89,8 +88,6 @@ extern void rxrpc_peer_calculate_rtt(struct rxrpc_peer *peer, extern void rxrpc_peer_clearall(struct rxrpc_transport *trans); -extern void rxrpc_peer_do_timeout(struct rxrpc_peer *peer); - /* * proc.c diff --git a/net/rxrpc/peer.c b/net/rxrpc/peer.c index e5c9f12d72db..ed38f5b17c1b 100644 --- a/net/rxrpc/peer.c +++ b/net/rxrpc/peer.c @@ -30,6 +30,8 @@ LIST_HEAD(rxrpc_peers); DECLARE_RWSEM(rxrpc_peers_sem); unsigned long rxrpc_peer_timeout = 12 * 60 * 60; +static void rxrpc_peer_do_timeout(struct rxrpc_peer *peer); + static void __rxrpc_peer_timeout(rxrpc_timer_t *timer) { struct rxrpc_peer *peer = @@ -259,7 +261,7 @@ void rxrpc_put_peer(struct rxrpc_peer *peer) * handle a peer timing out in the graveyard * - called from krxtimod */ -void rxrpc_peer_do_timeout(struct rxrpc_peer *peer) +static void rxrpc_peer_do_timeout(struct rxrpc_peer *peer) { struct rxrpc_transport *trans = peer->trans; diff --git a/net/rxrpc/rxrpc_syms.c b/net/rxrpc/rxrpc_syms.c index 76d95a3e2292..56adf16fed0c 100644 --- a/net/rxrpc/rxrpc_syms.c +++ b/net/rxrpc/rxrpc_syms.c @@ -23,7 +23,6 @@ EXPORT_SYMBOL(rxrpc_put_call); EXPORT_SYMBOL(rxrpc_call_abort); EXPORT_SYMBOL(rxrpc_call_read_data); EXPORT_SYMBOL(rxrpc_call_write_data); -EXPORT_SYMBOL(rxrpc_call_flush); /* connection.c */ EXPORT_SYMBOL(rxrpc_create_connection); diff --git a/net/rxrpc/transport.c b/net/rxrpc/transport.c index 7e015ceecee5..cd40f9c8befe 100644 --- a/net/rxrpc/transport.c +++ b/net/rxrpc/transport.c @@ -148,16 +148,6 @@ int rxrpc_create_transport(unsigned short port, return ret; } /* end rxrpc_create_transport() */ -/*****************************************************************************/ -/* - * clear the connections on a transport endpoint - */ -void rxrpc_clear_transport(struct rxrpc_transport *trans) -{ - //struct rxrpc_connection *conn; - -} /* end rxrpc_clear_transport() */ - /*****************************************************************************/ /* * destroy a transport endpoint -- cgit v1.2.3 From 77155e150ec78e53299c3f7f8bbf1720e83081d3 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 27 Dec 2004 04:51:40 -0800 Subject: [PKT_SCHED]: Staticize and other cleanups. The patch below contans the following possible cleanups: - make some needlessly global code static - sch_htb.c: #undef HTB_DEBUG Signed-off-by: Adrian Bunk Signed-off-by: David S. Miller --- include/net/act_api.h | 3 --- net/sched/gact.c | 2 +- net/sched/police.c | 8 ++++---- net/sched/sch_api.c | 11 ++++++----- net/sched/sch_dsmark.c | 2 +- net/sched/sch_generic.c | 4 ++-- net/sched/sch_htb.c | 2 +- net/sched/sch_ingress.c | 2 +- net/sched/sch_prio.c | 3 ++- 9 files changed, 18 insertions(+), 19 deletions(-) (limited to 'include') diff --git a/include/net/act_api.h b/include/net/act_api.h index 221ea5ed6b34..12736d17d3a3 100644 --- a/include/net/act_api.h +++ b/include/net/act_api.h @@ -82,9 +82,6 @@ extern int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int); extern int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int); extern int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int); extern int tcf_action_copy_stats (struct sk_buff *,struct tc_action *); -extern int tcf_act_police_locate(struct rtattr *rta, struct rtattr *est,struct tc_action *,int , int ); -extern int tcf_act_police_dump(struct sk_buff *, struct tc_action *, int, int); -extern int tcf_act_police(struct sk_buff **skb, struct tc_action *a); #endif /* CONFIG_NET_CLS_ACT */ extern int tcf_police(struct sk_buff *skb, struct tcf_police *p); diff --git a/net/sched/gact.c b/net/sched/gact.c index 1cf0b1714391..a65d2d6689f6 100644 --- a/net/sched/gact.c +++ b/net/sched/gact.c @@ -68,7 +68,7 @@ gact_determ(struct tcf_gact *p) { } -g_rand gact_rand[MAX_RAND]= { NULL,gact_net_rand, gact_determ}; +static g_rand gact_rand[MAX_RAND]= { NULL,gact_net_rand, gact_determ}; #endif static int diff --git a/net/sched/police.c b/net/sched/police.c index 13fe565ae886..b8c54c5727e5 100644 --- a/net/sched/police.c +++ b/net/sched/police.c @@ -163,7 +163,7 @@ void tcf_police_destroy(struct tcf_police *p) } #ifdef CONFIG_NET_CLS_ACT -int tcf_act_police_locate(struct rtattr *rta, struct rtattr *est,struct tc_action *a, int ovr, int bind) +static int tcf_act_police_locate(struct rtattr *rta, struct rtattr *est,struct tc_action *a, int ovr, int bind) { unsigned h; int ret = 0; @@ -272,7 +272,7 @@ failure: return -1; } -int tcf_act_police_cleanup(struct tc_action *a, int bind) +static int tcf_act_police_cleanup(struct tc_action *a, int bind) { struct tcf_police *p; p = PRIV(a); @@ -282,7 +282,7 @@ int tcf_act_police_cleanup(struct tc_action *a, int bind) return 0; } -int tcf_act_police(struct sk_buff **pskb, struct tc_action *a) +static int tcf_act_police(struct sk_buff **pskb, struct tc_action *a) { psched_time_t now; struct sk_buff *skb = *pskb; @@ -345,7 +345,7 @@ int tcf_act_police(struct sk_buff **pskb, struct tc_action *a) return p->action; } -int tcf_act_police_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) +static int tcf_act_police_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) { unsigned char *b = skb->tail; struct tc_police opt; diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index fff96b79613e..a8570f361d6d 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -207,7 +207,7 @@ struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle) return NULL; } -struct Qdisc *qdisc_leaf(struct Qdisc *p, u32 classid) +static struct Qdisc *qdisc_leaf(struct Qdisc *p, u32 classid) { unsigned long cl; struct Qdisc *leaf; @@ -226,7 +226,7 @@ struct Qdisc *qdisc_leaf(struct Qdisc *p, u32 classid) /* Find queueing discipline by name */ -struct Qdisc_ops *qdisc_lookup_ops(struct rtattr *kind) +static struct Qdisc_ops *qdisc_lookup_ops(struct rtattr *kind) { struct Qdisc_ops *q = NULL; @@ -290,7 +290,7 @@ void qdisc_put_rtab(struct qdisc_rate_table *tab) /* Allocate an unique handle from space managed by kernel */ -u32 qdisc_alloc_handle(struct net_device *dev) +static u32 qdisc_alloc_handle(struct net_device *dev) { int i = 0x10000; static u32 autohandle = TC_H_MAKE(0x80000000U, 0); @@ -356,8 +356,9 @@ dev_graft_qdisc(struct net_device *dev, struct Qdisc *qdisc) Old qdisc is not destroyed but returned in *old. */ -int qdisc_graft(struct net_device *dev, struct Qdisc *parent, u32 classid, - struct Qdisc *new, struct Qdisc **old) +static int qdisc_graft(struct net_device *dev, struct Qdisc *parent, + u32 classid, + struct Qdisc *new, struct Qdisc **old) { int err = 0; struct Qdisc *q = *old; diff --git a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c index 96203ed84151..d617b7aa6f56 100644 --- a/net/sched/sch_dsmark.c +++ b/net/sched/sch_dsmark.c @@ -320,7 +320,7 @@ static unsigned int dsmark_drop(struct Qdisc *sch) } -int dsmark_init(struct Qdisc *sch,struct rtattr *opt) +static int dsmark_init(struct Qdisc *sch,struct rtattr *opt) { struct dsmark_qdisc_data *p = PRIV(sch); struct rtattr *tb[TCA_DSMARK_MAX]; diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 1b9180944904..35e87b35a33f 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c @@ -283,7 +283,7 @@ struct Qdisc noop_qdisc = { .list = LIST_HEAD_INIT(noop_qdisc.list), }; -struct Qdisc_ops noqueue_qdisc_ops = { +static struct Qdisc_ops noqueue_qdisc_ops = { .next = NULL, .cl_ops = NULL, .id = "noqueue", @@ -294,7 +294,7 @@ struct Qdisc_ops noqueue_qdisc_ops = { .owner = THIS_MODULE, }; -struct Qdisc noqueue_qdisc = { +static struct Qdisc noqueue_qdisc = { .enqueue = NULL, .dequeue = noop_dequeue, .flags = TCQ_F_BUILTIN, diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 2de5a8a01481..25fa2c06f139 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c @@ -71,7 +71,7 @@ #define HTB_HSIZE 16 /* classid hash size */ #define HTB_EWMAC 2 /* rate average over HTB_EWMAC*HTB_HSIZE sec */ -#define HTB_DEBUG 1 /* compile debugging support (activated by tc tool) */ +#undef HTB_DEBUG /* compile debugging support (activated by tc tool) */ #define HTB_RATECM 1 /* whether to use rate computer */ #define HTB_HYSTERESIS 1/* whether to use mode hysteresis for speedup */ #define HTB_QLOCK(S) spin_lock_bh(&(S)->dev->queue_lock) diff --git a/net/sched/sch_ingress.c b/net/sched/sch_ingress.c index 7ea1d35e1cce..fd751a57fff1 100644 --- a/net/sched/sch_ingress.c +++ b/net/sched/sch_ingress.c @@ -274,7 +274,7 @@ static struct nf_hook_ops ing_ops = { #endif #endif -int ingress_init(struct Qdisc *sch,struct rtattr *opt) +static int ingress_init(struct Qdisc *sch,struct rtattr *opt) { struct ingress_qdisc_data *p = PRIV(sch); diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c index 7804835a2d37..2f06270cad4b 100644 --- a/net/sched/sch_prio.c +++ b/net/sched/sch_prio.c @@ -47,7 +47,8 @@ struct prio_sched_data }; -struct Qdisc *prio_classify(struct sk_buff *skb, struct Qdisc *sch,int *r) +static struct Qdisc *prio_classify(struct sk_buff *skb, + struct Qdisc *sch, int *r) { struct prio_sched_data *q = qdisc_priv(sch); u32 band = skb->priority; -- cgit v1.2.3 From 7ce0e70b83543e37bb39b136b1743d3bb06eef60 Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Mon, 27 Dec 2004 05:25:02 -0800 Subject: [NET]: Use prefetching in skb_queue_walk(). This patch changes skb_queue_walk() in the same manner as in list_for_each() prefetch optimization, see http://marc.theaimsgroup.com/?l=linux-kernel&m=110399132418587 Signed-off-by: Oleg Nesterov Signed-off-by: David S. Miller --- include/linux/skbuff.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 57a2843faa21..b1d0c472d19c 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -1077,9 +1077,9 @@ static inline void kunmap_skb_frag(void *vaddr) } #define skb_queue_walk(queue, skb) \ - for (skb = (queue)->next, prefetch(skb->next); \ - (skb != (struct sk_buff *)(queue)); \ - skb = skb->next, prefetch(skb->next)) + for (skb = (queue)->next; \ + prefetch(skb->next), (skb != (struct sk_buff *)(queue)); \ + skb = skb->next) extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, -- cgit v1.2.3 From 018b2fb54b77b14ed667844fded529f371de7f81 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Mon, 27 Dec 2004 19:57:10 -0200 Subject: [INET] move inet_sock into inet_opt and rename it to inet_sock With this we can remove all the cut'n'pasted layouts in all inet_sock derived classes, such as tcp_sock, udp_sock, sctp_sock, etc. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller --- include/linux/ip.h | 24 ++++++++++-------------- include/linux/ipv6.h | 14 ++++---------- include/linux/tcp.h | 6 +----- include/linux/udp.h | 6 +----- include/net/icmp.h | 8 +------- include/net/sctp/sctp.h | 12 +++--------- include/net/tcp.h | 2 +- net/ipv4/af_inet.c | 10 +++++----- net/ipv4/datagram.c | 2 +- net/ipv4/icmp.c | 4 ++-- net/ipv4/igmp.c | 16 ++++++++-------- net/ipv4/ip_output.c | 16 ++++++++-------- net/ipv4/ip_sockglue.c | 12 ++++++------ net/ipv4/ipvs/ip_vs_sync.c | 6 +++--- net/ipv4/netfilter/ip_conntrack_core.c | 2 +- net/ipv4/raw.c | 14 +++++++------- net/ipv4/tcp.c | 4 ++-- net/ipv4/tcp_diag.c | 14 +++++++------- net/ipv4/tcp_input.c | 2 +- net/ipv4/tcp_ipv4.c | 32 ++++++++++++++++---------------- net/ipv4/tcp_minisocks.c | 2 +- net/ipv4/tcp_output.c | 2 +- net/ipv4/tcp_timer.c | 2 +- net/ipv4/udp.c | 20 ++++++++++---------- net/ipv6/af_inet6.c | 10 ++++------ net/ipv6/datagram.c | 4 ++-- net/ipv6/ip6_output.c | 6 +++--- net/ipv6/raw.c | 10 +++++----- net/ipv6/tcp_ipv6.c | 20 ++++++++++---------- net/ipv6/udp.c | 12 ++++++------ net/sctp/input.c | 2 +- net/sctp/ipv6.c | 6 +++--- net/sctp/protocol.c | 4 ++-- security/selinux/avc.c | 4 ++-- 34 files changed, 139 insertions(+), 171 deletions(-) (limited to 'include') diff --git a/include/linux/ip.h b/include/linux/ip.h index 12d504ef8df0..3fe93474047d 100644 --- a/include/linux/ip.h +++ b/include/linux/ip.h @@ -107,7 +107,14 @@ struct ip_options { #define optlength(opt) (sizeof(struct ip_options) + opt->optlen) -struct inet_opt { +struct ipv6_pinfo; + +struct inet_sock { + /* sk and pinet6 has to be the first two members of inet_sock */ + struct sock sk; +#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) + struct ipv6_pinfo *pinet6; +#endif /* Socket demultiplex comparisons on incoming packets. */ __u32 daddr; /* Foreign IPv4 addr */ __u32 rcv_saddr; /* Bound local IPv4 addr */ @@ -146,20 +153,9 @@ struct inet_opt { #define IPCORK_OPT 1 /* ip-options has been held in ipcork.opt */ -struct ipv6_pinfo; - -/* WARNING: don't change the layout of the members in inet_sock! */ -struct inet_sock { - struct sock sk; -#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) - struct ipv6_pinfo *pinet6; -#endif - struct inet_opt inet; -}; - -static inline struct inet_opt * inet_sk(const struct sock *__sk) +static inline struct inet_sock *inet_sk(const struct sock *sk) { - return &((struct inet_sock *)__sk)->inet; + return (struct inet_sock *)sk; } #endif diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index d7d1673880d5..d7c28b9db4fd 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h @@ -256,32 +256,26 @@ struct raw6_opt { /* WARNING: don't change the layout of the members in {raw,udp,tcp}6_sock! */ struct raw6_sock { - struct sock sk; - struct ipv6_pinfo *pinet6; - struct inet_opt inet; + struct inet_sock inet; struct raw6_opt raw6; struct ipv6_pinfo inet6; }; struct udp6_sock { - struct sock sk; - struct ipv6_pinfo *pinet6; - struct inet_opt inet; + struct inet_sock inet; struct udp_opt udp; struct ipv6_pinfo inet6; }; struct tcp6_sock { - struct sock sk; - struct ipv6_pinfo *pinet6; - struct inet_opt inet; + struct inet_sock inet; struct tcp_opt tcp; struct ipv6_pinfo inet6; }; static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk) { - return ((struct raw6_sock *)__sk)->pinet6; + return inet_sk(__sk)->pinet6; } static inline struct raw6_opt * raw6_sk(const struct sock *__sk) diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 0902b9f496c3..61de59d3cef4 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h @@ -440,11 +440,7 @@ struct tcp_opt { /* WARNING: don't change the layout of the members in tcp_sock! */ struct tcp_sock { - struct sock sk; -#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) - struct ipv6_pinfo *pinet6; -#endif - struct inet_opt inet; + struct inet_sock inet; struct tcp_opt tcp; }; diff --git a/include/linux/udp.h b/include/linux/udp.h index facf661dd65a..831a3f532a10 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h @@ -53,11 +53,7 @@ struct udp_opt { /* WARNING: don't change the layout of the members in udp_sock! */ struct udp_sock { - struct sock sk; -#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) - struct ipv6_pinfo *pinet6; -#endif - struct inet_opt inet; + struct inet_sock inet; struct udp_opt udp; }; diff --git a/include/net/icmp.h b/include/net/icmp.h index aa260fcad767..32b159f7ae22 100644 --- a/include/net/icmp.h +++ b/include/net/icmp.h @@ -50,15 +50,9 @@ struct raw_opt { struct icmp_filter filter; }; -struct ipv6_pinfo; - /* WARNING: don't change the layout of the members in raw_sock! */ struct raw_sock { - struct sock sk; -#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) - struct ipv6_pinfo *pinet6; -#endif - struct inet_opt inet; + struct inet_sock inet; struct raw_opt raw4; }; diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 208c6aea06a1..f34b3aa1aa08 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h @@ -584,26 +584,20 @@ static inline int sctp_vtag_hashfn(__u16 lport, __u16 rport, __u32 vtag) /* WARNING: Do not change the layout of the members in sctp_sock! */ struct sctp_sock { - struct sock sk; -#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) - struct ipv6_pinfo *pinet6; -#endif /* CONFIG_IPV6 */ - struct inet_opt inet; + struct inet_sock inet; struct sctp_opt sctp; }; #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) struct sctp6_sock { - struct sock sk; - struct ipv6_pinfo *pinet6; - struct inet_opt inet; + struct inet_sock inet; struct sctp_opt sctp; struct ipv6_pinfo inet6; }; #endif /* CONFIG_IPV6 */ #define sctp_sk(__sk) (&((struct sctp_sock *)__sk)->sctp) -#define sctp_opt2sk(__sp) &container_of(__sp, struct sctp_sock, sctp)->sk +#define sctp_opt2sk(__sp) &container_of(__sp, struct sctp_sock, sctp)->inet.sk /* Is a socket of this style? */ #define sctp_style(sk, style) __sctp_style((sk), (SCTP_SOCKET_##style)) diff --git a/include/net/tcp.h b/include/net/tcp.h index f5bac4c9b704..a36011194820 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -196,7 +196,7 @@ struct tcp_tw_bucket { unsigned char tw_rcv_wscale; __u16 tw_sport; /* Socket demultiplex comparisons on incoming packets. */ - /* these five are in inet_opt */ + /* these five are in inet_sock */ __u32 tw_daddr __attribute__((aligned(TCP_ADDRCMP_ALIGN_BYTES))); __u32 tw_rcv_saddr; diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 56872058ebce..31e2097d80d6 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -131,7 +131,7 @@ static spinlock_t inetsw_lock = SPIN_LOCK_UNLOCKED; void inet_sock_destruct(struct sock *sk) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); __skb_queue_purge(&sk->sk_receive_queue); __skb_queue_purge(&sk->sk_error_queue); @@ -173,7 +173,7 @@ void inet_sock_destruct(struct sock *sk) static int inet_autobind(struct sock *sk) { - struct inet_opt *inet; + struct inet_sock *inet; /* We may need to bind the socket. */ lock_sock(sk); inet = inet_sk(sk); @@ -232,7 +232,7 @@ static int inet_create(struct socket *sock, int protocol) struct sock *sk; struct list_head *p; struct inet_protosw *answer; - struct inet_opt *inet; + struct inet_sock *inet; struct proto *answer_prot; unsigned char answer_flags; char answer_no_check; @@ -389,7 +389,7 @@ int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) { struct sockaddr_in *addr = (struct sockaddr_in *)uaddr; struct sock *sk = sock->sk; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); unsigned short snum; int chk_addr_ret; int err; @@ -623,7 +623,7 @@ int inet_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_len, int peer) { struct sock *sk = sock->sk; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct sockaddr_in *sin = (struct sockaddr_in *)uaddr; sin->sin_family = AF_INET; diff --git a/net/ipv4/datagram.c b/net/ipv4/datagram.c index f84e1041d2d9..b1db561f2542 100644 --- a/net/ipv4/datagram.c +++ b/net/ipv4/datagram.c @@ -22,7 +22,7 @@ int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct sockaddr_in *usin = (struct sockaddr_in *) uaddr; struct rtable *rt; u32 saddr; diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index 74089ab9f74e..3d975f2b01b1 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c @@ -377,7 +377,7 @@ static void icmp_push_reply(struct icmp_bxm *icmp_param, static void icmp_reply(struct icmp_bxm *icmp_param, struct sk_buff *skb) { struct sock *sk = icmp_socket->sk; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipcm_cookie ipc; struct rtable *rt = (struct rtable *)skb->dst; u32 daddr; @@ -1097,7 +1097,7 @@ static struct icmp_control icmp_pointers[NR_ICMP_TYPES + 1] = { void __init icmp_init(struct net_proto_family *ops) { - struct inet_opt *inet; + struct inet_sock *inet; int i; for (i = 0; i < NR_CPUS; i++) { diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index fc0c27f25f6a..8aa36e7a5d09 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c @@ -1617,7 +1617,7 @@ int ip_mc_join_group(struct sock *sk , struct ip_mreqn *imr) u32 addr = imr->imr_multiaddr.s_addr; struct ip_mc_socklist *iml, *i; struct in_device *in_dev; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); int count = 0; if (!MULTICAST(addr)) @@ -1691,7 +1691,7 @@ int ip_mc_leave_src(struct sock *sk, struct ip_mc_socklist *iml, int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ip_mc_socklist *iml, **imlp; rtnl_lock(); @@ -1734,7 +1734,7 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct u32 addr = mreqs->imr_multiaddr; struct ip_mc_socklist *pmc; struct in_device *in_dev = NULL; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ip_sf_socklist *psl; int i, j, rv; @@ -1852,7 +1852,7 @@ int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf, int ifindex) u32 addr = msf->imsf_multiaddr; struct ip_mc_socklist *pmc; struct in_device *in_dev; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ip_sf_socklist *newpsl, *psl; if (!MULTICAST(addr)) @@ -1922,7 +1922,7 @@ int ip_mc_msfget(struct sock *sk, struct ip_msfilter *msf, u32 addr = msf->imsf_multiaddr; struct ip_mc_socklist *pmc; struct in_device *in_dev; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ip_sf_socklist *psl; if (!MULTICAST(addr)) @@ -1980,7 +1980,7 @@ int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf, struct sockaddr_in *psin; u32 addr; struct ip_mc_socklist *pmc; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ip_sf_socklist *psl; psin = (struct sockaddr_in *)&gsf->gf_group; @@ -2033,7 +2033,7 @@ done: */ int ip_mc_sf_allow(struct sock *sk, u32 loc_addr, u32 rmt_addr, int dif) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ip_mc_socklist *pmc; struct ip_sf_socklist *psl; int i; @@ -2069,7 +2069,7 @@ int ip_mc_sf_allow(struct sock *sk, u32 loc_addr, u32 rmt_addr, int dif) void ip_mc_drop_socket(struct sock *sk) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ip_mc_socklist *iml; if (inet->mc_list == NULL) diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index d223d1251c1f..74f840473d70 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c @@ -115,7 +115,7 @@ static int ip_dev_loopback_xmit(struct sk_buff *newskb) return 0; } -static inline int ip_select_ttl(struct inet_opt *inet, struct dst_entry *dst) +static inline int ip_select_ttl(struct inet_sock *inet, struct dst_entry *dst) { int ttl = inet->uc_ttl; @@ -131,7 +131,7 @@ static inline int ip_select_ttl(struct inet_opt *inet, struct dst_entry *dst) int ip_build_and_send_pkt(struct sk_buff *skb, struct sock *sk, u32 saddr, u32 daddr, struct ip_options *opt) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct rtable *rt = (struct rtable *)skb->dst; struct iphdr *iph; @@ -297,7 +297,7 @@ int ip_output(struct sk_buff *skb) int ip_queue_xmit(struct sk_buff *skb, int ipfragok) { struct sock *sk = skb->sk; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ip_options *opt = inet->opt; struct rtable *rt; struct iphdr *iph; @@ -712,7 +712,7 @@ int ip_append_data(struct sock *sk, struct ipcm_cookie *ipc, struct rtable *rt, unsigned int flags) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct sk_buff *skb; struct ip_options *opt = NULL; @@ -973,7 +973,7 @@ error: ssize_t ip_append_page(struct sock *sk, struct page *page, int offset, size_t size, int flags) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct sk_buff *skb; struct rtable *rt; struct ip_options *opt = NULL; @@ -1112,7 +1112,7 @@ int ip_push_pending_frames(struct sock *sk) { struct sk_buff *skb, *tmp_skb; struct sk_buff **tail_skb; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ip_options *opt = NULL; struct rtable *rt = inet->cork.rt; struct iphdr *iph; @@ -1217,7 +1217,7 @@ error: */ void ip_flush_pending_frames(struct sock *sk) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct sk_buff *skb; while ((skb = __skb_dequeue_tail(&sk->sk_write_queue)) != NULL) @@ -1260,7 +1260,7 @@ static int ip_reply_glue_bits(void *dptr, char *to, int offset, void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *arg, unsigned int len) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct { struct ip_options opt; char data[40]; diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index d352252326c1..6fe58d7565fd 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c @@ -112,7 +112,7 @@ void ip_cmsg_recv_retopts(struct msghdr *msg, struct sk_buff *skb) void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb) { - struct inet_opt *inet = inet_sk(skb->sk); + struct inet_sock *inet = inet_sk(skb->sk); unsigned flags = inet->cmsg_flags; /* Ordered by supposed usage frequency */ @@ -234,7 +234,7 @@ int ip_ra_control(struct sock *sk, unsigned char on, void (*destructor)(struct s void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err, u16 port, u32 info, u8 *payload) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct sock_exterr_skb *serr; if (!inet->recverr) @@ -263,7 +263,7 @@ void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err, void ip_local_error(struct sock *sk, int err, u32 daddr, u16 port, u32 info) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct sock_exterr_skb *serr; struct iphdr *iph; struct sk_buff *skb; @@ -342,7 +342,7 @@ int ip_recv_error(struct sock *sk, struct msghdr *msg, int len) sin = &errhdr.offender; sin->sin_family = AF_UNSPEC; if (serr->ee.ee_origin == SO_EE_ORIGIN_ICMP) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); sin->sin_family = AF_INET; sin->sin_addr.s_addr = skb->nh.iph->saddr; @@ -383,7 +383,7 @@ out: int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, int optlen) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); int val=0,err; if (level != SOL_IP) @@ -875,7 +875,7 @@ e_inval: int ip_getsockopt(struct sock *sk, int level, int optname, char __user *optval, int __user *optlen) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); int val; int len; diff --git a/net/ipv4/ipvs/ip_vs_sync.c b/net/ipv4/ipvs/ip_vs_sync.c index 45ab05a7f4d5..a7389993318c 100644 --- a/net/ipv4/ipvs/ip_vs_sync.c +++ b/net/ipv4/ipvs/ip_vs_sync.c @@ -343,7 +343,7 @@ static void ip_vs_process_message(const char *buffer, const size_t buflen) */ static void set_mcast_loop(struct sock *sk, u_char loop) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); /* setsockopt(sock, SOL_IP, IP_MULTICAST_LOOP, &loop, sizeof(loop)); */ lock_sock(sk); @@ -356,7 +356,7 @@ static void set_mcast_loop(struct sock *sk, u_char loop) */ static void set_mcast_ttl(struct sock *sk, u_char ttl) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); /* setsockopt(sock, SOL_IP, IP_MULTICAST_TTL, &ttl, sizeof(ttl)); */ lock_sock(sk); @@ -370,7 +370,7 @@ static void set_mcast_ttl(struct sock *sk, u_char ttl) static int set_mcast_if(struct sock *sk, char *ifname) { struct net_device *dev; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); if ((dev = __dev_get_by_name(ifname)) == NULL) return -ENODEV; diff --git a/net/ipv4/netfilter/ip_conntrack_core.c b/net/ipv4/netfilter/ip_conntrack_core.c index d14a4e342de3..5f859e657576 100644 --- a/net/ipv4/netfilter/ip_conntrack_core.c +++ b/net/ipv4/netfilter/ip_conntrack_core.c @@ -1229,7 +1229,7 @@ ip_ct_selective_cleanup(int (*kill)(const struct ip_conntrack *i, void *data), static int getorigdst(struct sock *sk, int optval, void __user *user, int *len) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ip_conntrack_tuple_hash *h; struct ip_conntrack_tuple tuple; diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index 2c6dd971b10a..92f18ac1de66 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c @@ -109,7 +109,7 @@ struct sock *__raw_v4_lookup(struct sock *sk, unsigned short num, struct hlist_node *node; sk_for_each_from(sk, node) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); if (inet->num == num && !(inet->daddr && inet->daddr != raddr) && @@ -181,7 +181,7 @@ out: void raw_err (struct sock *sk, struct sk_buff *skb, u32 info) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); int type = skb->h.icmph->type; int code = skb->h.icmph->code; int err = 0; @@ -263,7 +263,7 @@ static int raw_send_hdrinc(struct sock *sk, void *from, int length, struct rtable *rt, unsigned int flags) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); int hh_len; struct iphdr *iph; struct sk_buff *skb; @@ -374,7 +374,7 @@ static void raw_probe_proto_opt(struct flowi *fl, struct msghdr *msg) static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, size_t len) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipcm_cookie ipc; struct rtable *rt = NULL; int free = 0; @@ -537,7 +537,7 @@ static void raw_close(struct sock *sk, long timeout) /* This gets rid of all the nasties in af_inet. -DaveM */ static int raw_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct sockaddr_in *addr = (struct sockaddr_in *) uaddr; int ret = -EINVAL; int chk_addr_ret; @@ -565,7 +565,7 @@ out: return ret; int raw_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, size_t len, int noblock, int flags, int *addr_len) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); size_t copied = 0; int err = -EOPNOTSUPP; struct sockaddr_in *sin = (struct sockaddr_in *)msg->msg_name; @@ -802,7 +802,7 @@ static void raw_seq_stop(struct seq_file *seq, void *v) static __inline__ char *get_raw_sock(struct sock *sp, char *tmpbuf, int i) { - struct inet_opt *inet = inet_sk(sp); + struct inet_sock *inet = inet_sk(sp); unsigned int dest = inet->daddr, src = inet->rcv_saddr; __u16 destp = 0, diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 4c10aa8c3b8d..f1bff9647a2b 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -460,7 +460,7 @@ int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg) int tcp_listen_start(struct sock *sk) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct tcp_opt *tp = tcp_sk(sk); struct tcp_listen_opt *lopt; @@ -1772,7 +1772,7 @@ static inline int tcp_need_reset(int state) int tcp_disconnect(struct sock *sk, int flags) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct tcp_opt *tp = tcp_sk(sk); int err = 0; int old_state = sk->sk_state; diff --git a/net/ipv4/tcp_diag.c b/net/ipv4/tcp_diag.c index be78fa284c0d..cbaa439ee83c 100644 --- a/net/ipv4/tcp_diag.c +++ b/net/ipv4/tcp_diag.c @@ -55,7 +55,7 @@ static struct sock *tcpnl; static int tcpdiag_fill(struct sk_buff *skb, struct sock *sk, int ext, u32 pid, u32 seq, u16 nlmsg_flags) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct tcp_opt *tp = tcp_sk(sk); struct tcpdiagmsg *r; struct nlmsghdr *nlh; @@ -427,7 +427,7 @@ static int tcpdiag_dump_sock(struct sk_buff *skb, struct sock *sk, if (cb->nlh->nlmsg_len > 4 + NLMSG_SPACE(sizeof(*r))) { struct tcpdiag_entry entry; struct rtattr *bc = (struct rtattr *)(r + 1); - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); entry.family = sk->sk_family; #ifdef CONFIG_IP_TCPDIAG_IPV6 @@ -458,7 +458,7 @@ static int tcpdiag_fill_req(struct sk_buff *skb, struct sock *sk, struct open_request *req, u32 pid, u32 seq) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); unsigned char *b = skb->tail; struct tcpdiagmsg *r; struct nlmsghdr *nlh; @@ -515,7 +515,7 @@ static int tcpdiag_dump_reqs(struct sk_buff *skb, struct sock *sk, struct tcp_opt *tp = tcp_sk(sk); struct tcp_listen_opt *lopt; struct rtattr *bc = NULL; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); int j, s_j; int reqnum, s_reqnum; int err = 0; @@ -609,7 +609,7 @@ static int tcpdiag_dump(struct sk_buff *skb, struct netlink_callback *cb) num = 0; sk_for_each(sk, node, &tcp_listening_hash[i]) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); if (num < s_num) { num++; @@ -670,7 +670,7 @@ skip_listen_ht: num = 0; sk_for_each(sk, node, &head->chain) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); if (num < s_num) goto next_normal; @@ -692,7 +692,7 @@ next_normal: if (r->tcpdiag_states&TCPF_TIME_WAIT) { sk_for_each(sk, node, &tcp_ehash[i + tcp_ehash_size].chain) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); if (num < s_num) goto next_dying; diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index a0f598569886..3183e2913faa 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -1647,7 +1647,7 @@ static __inline__ int tcp_packet_delayed(struct tcp_opt *tp) #if FASTRETRANS_DEBUG > 1 static void DBGUNDO(struct sock *sk, struct tcp_opt *tp, const char *msg) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); printk(KERN_DEBUG "Undo %s %u.%u.%u.%u/%u c%u l%u ss%u/%u p%u\n", msg, NIPQUAD(inet->daddr), ntohs(inet->dport), diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 3062579ef720..6c5b44af65b2 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -115,7 +115,7 @@ static __inline__ int tcp_hashfn(__u32 laddr, __u16 lport, static __inline__ int tcp_sk_hashfn(struct sock *sk) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); __u32 laddr = inet->rcv_saddr; __u16 lport = inet->num; __u32 faddr = inet->daddr; @@ -300,7 +300,7 @@ fail: */ static void __tcp_put_port(struct sock *sk) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct tcp_bind_hashbucket *head = &tcp_bhash[tcp_bhashfn(inet->num)]; struct tcp_bind_bucket *tb; @@ -420,7 +420,7 @@ static struct sock *__tcp_v4_lookup_listener(struct hlist_head *head, u32 daddr, hiscore=-1; sk_for_each(sk, node, head) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); if (inet->num == hnum && !ipv6_only_sock(sk)) { __u32 rcv_saddr = inet->rcv_saddr; @@ -457,7 +457,7 @@ static inline struct sock *tcp_v4_lookup_listener(u32 daddr, read_lock(&tcp_lhash_lock); head = &tcp_listening_hash[tcp_lhashfn(hnum)]; if (!hlist_empty(head)) { - struct inet_opt *inet = inet_sk((sk = __sk_head(head))); + struct inet_sock *inet = inet_sk((sk = __sk_head(head))); if (inet->num == hnum && !sk->sk_node.next && (!inet->rcv_saddr || inet->rcv_saddr == daddr) && @@ -549,7 +549,7 @@ static inline __u32 tcp_v4_init_sequence(struct sock *sk, struct sk_buff *skb) static int __tcp_v4_check_established(struct sock *sk, __u16 lport, struct tcp_tw_bucket **twp) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); u32 daddr = inet->rcv_saddr; u32 saddr = inet->daddr; int dif = sk->sk_bound_dev_if; @@ -638,7 +638,7 @@ not_unique: static inline u32 connect_port_offset(const struct sock *sk) { - const struct inet_opt *inet = inet_sk(sk); + const struct inet_sock *inet = inet_sk(sk); return secure_tcp_port_ephemeral(inet->rcv_saddr, inet->daddr, inet->dport); @@ -743,7 +743,7 @@ out: /* This will initiate an outgoing connection. */ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct tcp_opt *tp = tcp_sk(sk); struct sockaddr_in *usin = (struct sockaddr_in *)uaddr; struct rtable *rt; @@ -917,7 +917,7 @@ static inline void do_pmtu_discovery(struct sock *sk, struct iphdr *iph, u32 mtu) { struct dst_entry *dst; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct tcp_opt *tp = tcp_sk(sk); /* We are not interested in TCP_LISTEN and open_requests (SYN-ACKs @@ -980,7 +980,7 @@ void tcp_v4_err(struct sk_buff *skb, u32 info) struct iphdr *iph = (struct iphdr *)skb->data; struct tcphdr *th = (struct tcphdr *)(skb->data + (iph->ihl << 2)); struct tcp_opt *tp; - struct inet_opt *inet; + struct inet_sock *inet; int type = skb->h.icmph->type; int code = skb->h.icmph->code; struct sock *sk; @@ -1127,7 +1127,7 @@ out: void tcp_v4_send_check(struct sock *sk, struct tcphdr *th, int len, struct sk_buff *skb) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); if (skb->ip_summed == CHECKSUM_HW) { th->check = ~tcp_v4_check(th, len, inet->saddr, inet->daddr, 0); @@ -1549,7 +1549,7 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb, struct open_request *req, struct dst_entry *dst) { - struct inet_opt *newinet; + struct inet_sock *newinet; struct tcp_opt *newtp; struct sock *newsk; @@ -1856,7 +1856,7 @@ static void __tcp_v4_rehash(struct sock *sk) static int tcp_v4_reselect_saddr(struct sock *sk) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); int err; struct rtable *rt; __u32 old_saddr = inet->saddr; @@ -1907,7 +1907,7 @@ static int tcp_v4_reselect_saddr(struct sock *sk) int tcp_v4_rebuild_header(struct sock *sk) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct rtable *rt = (struct rtable *)__sk_dst_check(sk, 0); u32 daddr; int err; @@ -1956,7 +1956,7 @@ int tcp_v4_rebuild_header(struct sock *sk) static void v4_addr2sockaddr(struct sock *sk, struct sockaddr * uaddr) { struct sockaddr_in *sin = (struct sockaddr_in *) uaddr; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); sin->sin_family = AF_INET; sin->sin_addr.s_addr = inet->daddr; @@ -1971,7 +1971,7 @@ static void v4_addr2sockaddr(struct sock *sk, struct sockaddr * uaddr) int tcp_v4_remember_stamp(struct sock *sk) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct tcp_opt *tp = tcp_sk(sk); struct rtable *rt = (struct rtable *)__sk_dst_get(sk); struct inet_peer *peer = NULL; @@ -2474,7 +2474,7 @@ static void get_tcp4_sock(struct sock *sp, char *tmpbuf, int i) int timer_active; unsigned long timer_expires; struct tcp_opt *tp = tcp_sk(sp); - struct inet_opt *inet = inet_sk(sp); + struct inet_sock *inet = inet_sk(sp); unsigned int dest = inet->daddr; unsigned int src = inet->rcv_saddr; __u16 destp = ntohs(inet->dport); diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index d5b6ea321305..5e431bcf1d86 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c @@ -337,7 +337,7 @@ void tcp_time_wait(struct sock *sk, int state, int timeo) tw = kmem_cache_alloc(tcp_timewait_cachep, SLAB_ATOMIC); if(tw != NULL) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); int rto = (tp->rto<<2) - (tp->rto>>1); /* Give us an identity. */ diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 0b08a3499b29..6c6fcf22bf79 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -266,7 +266,7 @@ static __inline__ u16 tcp_select_window(struct sock *sk) static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb) { if (skb != NULL) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct tcp_opt *tp = tcp_sk(sk); struct tcp_skb_cb *tcb = TCP_SKB_CB(skb); int tcp_header_size = tp->tcp_header_len; diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index 3b4d82176a84..28888af7dcf0 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c @@ -332,7 +332,7 @@ static void tcp_retransmit_timer(struct sock *sk) */ #ifdef TCP_DEBUG if (net_ratelimit()) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); printk(KERN_DEBUG "TCP: Treason uncloaked! Peer %u.%u.%u.%u:%u/%u shrinks window %u:%u. Repaired.\n", NIPQUAD(inet->daddr), htons(inet->dport), inet->num, tp->snd_una, tp->snd_nxt); diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 4a1bfb39c4b0..398214e53ad5 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -124,7 +124,7 @@ static int udp_v4_get_port(struct sock *sk, unsigned short snum) { struct hlist_node *node; struct sock *sk2; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); write_lock_bh(&udp_hash_lock); if (snum == 0) { @@ -171,7 +171,7 @@ gotit: } else { sk_for_each(sk2, node, &udp_hash[snum & (UDP_HTABLE_SIZE - 1)]) { - struct inet_opt *inet2 = inet_sk(sk2); + struct inet_sock *inet2 = inet_sk(sk2); if (inet2->num == snum && sk2 != sk && @@ -227,7 +227,7 @@ struct sock *udp_v4_lookup_longway(u32 saddr, u16 sport, u32 daddr, u16 dport, i int badness = -1; sk_for_each(sk, node, &udp_hash[hnum & (UDP_HTABLE_SIZE - 1)]) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); if (inet->num == hnum && !ipv6_only_sock(sk)) { int score = (sk->sk_family == PF_INET ? 1 : 0); @@ -285,7 +285,7 @@ static inline struct sock *udp_v4_mcast_next(struct sock *sk, unsigned short hnum = ntohs(loc_port); sk_for_each_from(s, node) { - struct inet_opt *inet = inet_sk(s); + struct inet_sock *inet = inet_sk(s); if (inet->num != hnum || (inet->daddr && inet->daddr != rmt_addr) || @@ -316,7 +316,7 @@ found: void udp_err(struct sk_buff *skb, u32 info) { - struct inet_opt *inet; + struct inet_sock *inet; struct iphdr *iph = (struct iphdr*)skb->data; struct udphdr *uh = (struct udphdr*)(skb->data+(iph->ihl<<2)); int type = skb->h.icmph->type; @@ -398,7 +398,7 @@ static void udp_flush_pending_frames(struct sock *sk) */ static int udp_push_pending_frames(struct sock *sk, struct udp_opt *up) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct flowi *fl = &inet->cork.fl; struct sk_buff *skb; struct udphdr *uh; @@ -480,7 +480,7 @@ static unsigned short udp_check(struct udphdr *uh, int len, unsigned long saddr, int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, size_t len) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct udp_opt *up = udp_sk(sk); int ulen = len; struct ipcm_cookie ipc; @@ -773,7 +773,7 @@ static __inline__ int udp_checksum_complete(struct sk_buff *skb) int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, size_t len, int noblock, int flags, int *addr_len) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct sockaddr_in *sin = (struct sockaddr_in *)msg->msg_name; struct sk_buff *skb; int copied, err; @@ -864,7 +864,7 @@ csum_copy_err: int udp_disconnect(struct sock *sk, int flags) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); /* * 1003.1g - break association. */ @@ -1503,7 +1503,7 @@ void udp_proc_unregister(struct udp_seq_afinfo *afinfo) /* ------------------------------------------------------------------------ */ static void udp4_format_sock(struct sock *sp, char *tmpbuf, int bucket) { - struct inet_opt *inet = inet_sk(sp); + struct inet_sock *inet = inet_sk(sp); unsigned int dest = inet->daddr; unsigned int src = inet->rcv_saddr; __u16 destp = ntohs(inet->dport); diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index fac7d9cdf238..5ca3af45cfeb 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c @@ -114,10 +114,9 @@ static __inline__ struct ipv6_pinfo *inet6_sk_generic(struct sock *sk) static int inet6_create(struct socket *sock, int protocol) { - struct inet_opt *inet; + struct inet_sock *inet; struct ipv6_pinfo *np; struct sock *sk; - struct tcp6_sock* tcp6sk; struct list_head *p; struct inet_protosw *answer; struct proto *answer_prot; @@ -196,8 +195,7 @@ static int inet6_create(struct socket *sock, int protocol) sk->sk_backlog_rcv = answer->prot->backlog_rcv; - tcp6sk = (struct tcp6_sock *)sk; - tcp6sk->pinet6 = np = inet6_sk_generic(sk); + inet_sk(sk)->pinet6 = np = inet6_sk_generic(sk); np->hop_limit = -1; np->mcast_hops = -1; np->mc_loop = 1; @@ -252,7 +250,7 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) { struct sockaddr_in6 *addr=(struct sockaddr_in6 *)uaddr; struct sock *sk = sock->sk; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); __u32 v4addr = 0; unsigned short snum; @@ -410,7 +408,7 @@ int inet6_getname(struct socket *sock, struct sockaddr *uaddr, { struct sockaddr_in6 *sin=(struct sockaddr_in6 *)uaddr; struct sock *sk = sock->sk; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); sin->sin6_family = AF_INET6; diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c index b077cd19f576..65b9375df57d 100644 --- a/net/ipv6/datagram.c +++ b/net/ipv6/datagram.c @@ -36,7 +36,7 @@ int ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) { struct sockaddr_in6 *usin = (struct sockaddr_in6 *) uaddr; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct in6_addr *daddr, *final_p = NULL, final; struct dst_entry *dst; @@ -335,7 +335,7 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len) if (ipv6_addr_type(&sin->sin6_addr) & IPV6_ADDR_LINKLOCAL) sin->sin6_scope_id = IP6CB(skb)->iif; } else { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); ipv6_addr_set(&sin->sin6_addr, 0, 0, htonl(0xffff), diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 96e2925f4661..aec81a63b126 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c @@ -809,7 +809,7 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, int offse int hlimit, struct ipv6_txoptions *opt, struct flowi *fl, struct rt6_info *rt, unsigned int flags) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct sk_buff *skb; unsigned int maxfraglen, fragheaderlen; @@ -1087,7 +1087,7 @@ int ip6_push_pending_frames(struct sock *sk) struct sk_buff *skb, *tmp_skb; struct sk_buff **tail_skb; struct in6_addr final_dst_buf, *final_dst = &final_dst_buf; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct ipv6hdr *hdr; struct ipv6_txoptions *opt = np->cork.opt; @@ -1165,7 +1165,7 @@ error: void ip6_flush_pending_frames(struct sock *sk) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct sk_buff *skb; diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index 1e7ed8dcf1cb..0f28463ac350 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c @@ -178,7 +178,7 @@ out: /* This cleans up af_inet6 a bit. -DaveM */ static int rawv6_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct sockaddr_in6 *addr = (struct sockaddr_in6 *) uaddr; __u32 v4addr = 0; @@ -253,7 +253,7 @@ void rawv6_err(struct sock *sk, struct sk_buff *skb, struct inet6_skb_parm *opt, int type, int code, int offset, u32 info) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); int err; int harderr; @@ -314,7 +314,7 @@ static inline int rawv6_rcv_skb(struct sock * sk, struct sk_buff * skb) */ int rawv6_rcv(struct sock *sk, struct sk_buff *skb) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct raw6_opt *raw_opt = raw6_sk(sk); if (!xfrm6_policy_check(sk, XFRM_POLICY_IN, skb)) { @@ -505,7 +505,7 @@ static int rawv6_send_hdrinc(struct sock *sk, void *from, int length, struct flowi *fl, struct rt6_info *rt, unsigned int flags) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6hdr *iph; struct sk_buff *skb; unsigned int hh_len; @@ -607,7 +607,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk, struct ipv6_txoptions opt_space; struct sockaddr_in6 * sin6 = (struct sockaddr_in6 *) msg->msg_name; struct in6_addr *daddr, *final_p = NULL, final; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct raw6_opt *raw_opt = raw6_sk(sk); struct ipv6_txoptions *opt = NULL; diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 0ae13d6b19db..97fe88e10597 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -89,7 +89,7 @@ static __inline__ int tcp_v6_hashfn(struct in6_addr *laddr, u16 lport, static __inline__ int tcp_v6_sk_hashfn(struct sock *sk) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct in6_addr *laddr = &np->rcv_saddr; struct in6_addr *faddr = &np->daddr; @@ -443,7 +443,7 @@ static __u32 tcp_v6_init_sequence(struct sock *sk, struct sk_buff *skb) static int tcp_v6_check_established(struct sock *sk) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct in6_addr *daddr = &np->rcv_saddr; struct in6_addr *saddr = &np->daddr; @@ -549,7 +549,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) { struct sockaddr_in6 *usin = (struct sockaddr_in6 *) uaddr; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct tcp_opt *tp = tcp_sk(sk); struct in6_addr *saddr = NULL, *final_p = NULL, final; @@ -785,7 +785,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, dst = __sk_dst_check(sk, np->dst_cookie); if (dst == NULL) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct flowi fl; /* BUGGG_FUTURE: Again, it is not clear how @@ -1281,7 +1281,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, { struct ipv6_pinfo *newnp, *np = inet6_sk(sk); struct tcp6_sock *newtcp6sk; - struct inet_opt *newinet; + struct inet_sock *newinet; struct tcp_opt *newtp; struct sock *newsk; struct ipv6_txoptions *opt; @@ -1297,7 +1297,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, return NULL; newtcp6sk = (struct tcp6_sock *)newsk; - newtcp6sk->pinet6 = &newtcp6sk->inet6; + newtcp6sk->inet.pinet6 = &newtcp6sk->inet6; newinet = inet_sk(newsk); newnp = inet6_sk(newsk); @@ -1390,7 +1390,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, ~(NETIF_F_IP_CSUM | NETIF_F_TSO); newtcp6sk = (struct tcp6_sock *)newsk; - newtcp6sk->pinet6 = &newtcp6sk->inet6; + newtcp6sk->inet.pinet6 = &newtcp6sk->inet6; newtp = tcp_sk(newsk); newinet = inet_sk(newsk); @@ -1754,7 +1754,7 @@ static int tcp_v6_rebuild_header(struct sock *sk) dst = __sk_dst_check(sk, np->dst_cookie); if (dst == NULL) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct in6_addr *final_p = NULL, final; struct flowi fl; @@ -1800,7 +1800,7 @@ static int tcp_v6_rebuild_header(struct sock *sk) static int tcp_v6_xmit(struct sk_buff *skb, int ipfragok) { struct sock *sk = skb->sk; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct flowi fl; struct dst_entry *dst; @@ -2006,7 +2006,7 @@ static void get_tcp6_sock(struct seq_file *seq, struct sock *sp, int i) __u16 destp, srcp; int timer_active; unsigned long timer_expires; - struct inet_opt *inet = inet_sk(sp); + struct inet_sock *inet = inet_sk(sp); struct tcp_opt *tp = tcp_sk(sp); struct ipv6_pinfo *np = inet6_sk(sp); diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index dc0bbfb4c1c9..019318679817 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@ -160,7 +160,7 @@ static struct sock *udp_v6_lookup(struct in6_addr *saddr, u16 sport, read_lock(&udp_hash_lock); sk_for_each(sk, node, &udp_hash[hnum & (UDP_HTABLE_SIZE - 1)]) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); if (inet->num == hnum && sk->sk_family == PF_INET6) { struct ipv6_pinfo *np = inet6_sk(sk); @@ -269,7 +269,7 @@ try_again: sin6->sin6_scope_id = 0; if (skb->protocol == htons(ETH_P_IP)) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); ipv6_addr_set(&sin6->sin6_addr, 0, 0, htonl(0xffff), skb->nh.iph->saddr); @@ -386,7 +386,7 @@ static struct sock *udp_v6_mcast_next(struct sock *sk, unsigned short num = ntohs(loc_port); sk_for_each_from(s, node) { - struct inet_opt *inet = inet_sk(s); + struct inet_sock *inet = inet_sk(s); if (inet->num == num && s->sk_family == PF_INET6) { struct ipv6_pinfo *np = inet6_sk(s); @@ -566,7 +566,7 @@ static int udp_v6_push_pending_frames(struct sock *sk, struct udp_opt *up) { struct sk_buff *skb; struct udphdr *uh; - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct flowi *fl = &inet->cork.fl; int err = 0; @@ -624,7 +624,7 @@ static int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk, { struct ipv6_txoptions opt_space; struct udp_opt *up = udp_sk(sk); - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) msg->msg_name; struct in6_addr *daddr, *final_p = NULL, final; @@ -970,7 +970,7 @@ static struct inet6_protocol udpv6_protocol = { static void udp6_sock_seq_show(struct seq_file *seq, struct sock *sp, int bucket) { - struct inet_opt *inet = inet_sk(sp); + struct inet_sock *inet = inet_sk(sp); struct ipv6_pinfo *np = inet6_sk(sp); struct in6_addr *dest, *src; __u16 destp, srcp; diff --git a/net/sctp/input.c b/net/sctp/input.c index 0268f75c41e5..cab833371a54 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c @@ -393,7 +393,7 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info) struct sctp_endpoint *ep; struct sctp_association *asoc; struct sctp_transport *transport; - struct inet_opt *inet; + struct inet_sock *inet; char *saveip, *savesctp; int err; diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c index f657c4deedd9..e142681824ca 100644 --- a/net/sctp/ipv6.c +++ b/net/sctp/ipv6.c @@ -580,9 +580,9 @@ static sctp_scope_t sctp_v6_scope(union sctp_addr *addr) struct sock *sctp_v6_create_accept_sk(struct sock *sk, struct sctp_association *asoc) { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct sock *newsk; - struct inet_opt *newinet; + struct inet_sock *newinet; struct ipv6_pinfo *newnp, *np = inet6_sk(sk); struct sctp6_sock *newsctp6sk; @@ -608,7 +608,7 @@ struct sock *sctp_v6_create_accept_sk(struct sock *sk, newsk->sk_shutdown = sk->sk_shutdown; newsctp6sk = (struct sctp6_sock *)newsk; - newsctp6sk->pinet6 = &newsctp6sk->inet6; + newsctp6sk->inet.pinet6 = &newsctp6sk->inet6; newinet = inet_sk(newsk); newnp = inet6_sk(newsk); diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index 1f693e954621..a8a3f3d37efc 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c @@ -551,8 +551,8 @@ struct sock *sctp_v4_create_accept_sk(struct sock *sk, struct sctp_association *asoc) { struct sock *newsk; - struct inet_opt *inet = inet_sk(sk); - struct inet_opt *newinet; + struct inet_sock *inet = inet_sk(sk); + struct inet_sock *newinet; newsk = sk_alloc(PF_INET, GFP_KERNEL, sk->sk_prot->slab_obj_size, sk->sk_prot->slab); diff --git a/security/selinux/avc.c b/security/selinux/avc.c index 7afe09eed6ac..49af7bd9e40b 100644 --- a/security/selinux/avc.c +++ b/security/selinux/avc.c @@ -566,7 +566,7 @@ void avc_audit(u32 ssid, u32 tsid, switch (sk->sk_family) { case AF_INET: { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); avc_print_ipv4_addr(ab, inet->rcv_saddr, inet->sport, @@ -577,7 +577,7 @@ void avc_audit(u32 ssid, u32 tsid, break; } case AF_INET6: { - struct inet_opt *inet = inet_sk(sk); + struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *inet6 = inet6_sk(sk); avc_print_ipv6_addr(ab, &inet6->rcv_saddr, -- cgit v1.2.3 From 93f178381849e4fc519d1d26b76d4483500ad369 Mon Sep 17 00:00:00 2001 From: Roland Dreier Date: Mon, 27 Dec 2004 06:18:50 -0800 Subject: [INFINIBAND]: IPoIB IPv4 multicast Add ip_ib_mc_map() to convert IPv4 multicast addresses to IPoIB hardware addresses. Also add so INFINIBAND_ALEN has a home. The mapping for multicast addresses is described in http://www.ietf.org/internet-drafts/draft-ietf-ipoib-ip-over-infiniband-08.txt Signed-off-by: Roland Dreier Signed-off-by: David S. Miller --- include/linux/if_infiniband.h | 29 +++++++++++++++++++++++++++++ include/net/ip.h | 33 +++++++++++++++++++++++++++++++++ net/ipv4/arp.c | 3 +++ 3 files changed, 65 insertions(+) create mode 100644 include/linux/if_infiniband.h (limited to 'include') diff --git a/include/linux/if_infiniband.h b/include/linux/if_infiniband.h new file mode 100644 index 000000000000..3e659ec7dfdd --- /dev/null +++ b/include/linux/if_infiniband.h @@ -0,0 +1,29 @@ +/* + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available at + * , or the OpenIB.org BSD + * license, available in the LICENSE.TXT file accompanying this + * software. These details are also available at + * . + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Copyright (c) 2004 Topspin Communications. All rights reserved. + * + * $Id$ + */ + +#ifndef _LINUX_IF_INFINIBAND_H +#define _LINUX_IF_INFINIBAND_H + +#define INFINIBAND_ALEN 20 /* Octets in IPoIB HW addr */ + +#endif /* _LINUX_IF_INFINIBAND_H */ diff --git a/include/net/ip.h b/include/net/ip.h index 15a1c6a2e534..8dd01f2e84f6 100644 --- a/include/net/ip.h +++ b/include/net/ip.h @@ -229,6 +229,39 @@ static inline void ip_eth_mc_map(u32 addr, char *buf) buf[3]=addr&0x7F; } +/* + * Map a multicast IP onto multicast MAC for type IP-over-InfiniBand. + * Leave P_Key as 0 to be filled in by driver. + */ + +static inline void ip_ib_mc_map(u32 addr, char *buf) +{ + buf[0] = 0; /* Reserved */ + buf[1] = 0xff; /* Multicast QPN */ + buf[2] = 0xff; + buf[3] = 0xff; + addr = ntohl(addr); + buf[4] = 0xff; + buf[5] = 0x12; /* link local scope */ + buf[6] = 0x40; /* IPv4 signature */ + buf[7] = 0x1b; + buf[8] = 0; /* P_Key */ + buf[9] = 0; + buf[10] = 0; + buf[11] = 0; + buf[12] = 0; + buf[13] = 0; + buf[14] = 0; + buf[15] = 0; + buf[19] = addr & 0xff; + addr >>= 8; + buf[18] = addr & 0xff; + addr >>= 8; + buf[17] = addr & 0xff; + addr >>= 8; + buf[16] = addr & 0x0f; +} + #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) #include #endif diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 9b5d1e813652..734cc2f30e94 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c @@ -213,6 +213,9 @@ int arp_mc_map(u32 addr, u8 *haddr, struct net_device *dev, int dir) case ARPHRD_IEEE802_TR: ip_tr_mc_map(addr, haddr); return 0; + case ARPHRD_INFINIBAND: + ip_ib_mc_map(addr, haddr); + return 0; default: if (dir) { memcpy(haddr, dev->broadcast, dev->addr_len); -- cgit v1.2.3 From 3097829ccb904ab64e44a9cc0f4daa0c97fcd0fe Mon Sep 17 00:00:00 2001 From: Roland Dreier Date: Mon, 27 Dec 2004 06:19:47 -0800 Subject: [INFINIBAND]: IPoIB IPv6 support Add ipv6_ib_mc_map() to convert IPv6 multicast addresses to IPoIB hardware addresses, and add support for autoconfiguration for devices with type ARPHRD_INFINIBAND. The mapping for multicast addresses is described in http://www.ietf.org/internet-drafts/draft-ietf-ipoib-ip-over-infiniband-08.txt Signed-off-by: Nitin Hande Signed-off-by: Roland Dreier Signed-off-by: David S. Miller --- include/net/if_inet6.h | 15 +++++++++++++++ net/ipv6/addrconf.c | 10 +++++++++- net/ipv6/ndisc.c | 3 +++ 3 files changed, 27 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h index 76ce5f8b6c1e..e97a9accb71d 100644 --- a/include/net/if_inet6.h +++ b/include/net/if_inet6.h @@ -266,5 +266,20 @@ static inline void ipv6_arcnet_mc_map(const struct in6_addr *addr, char *buf) { buf[0] = 0x00; } + +static inline void ipv6_ib_mc_map(struct in6_addr *addr, char *buf) +{ + buf[0] = 0; /* Reserved */ + buf[1] = 0xff; /* Multicast QPN */ + buf[2] = 0xff; + buf[3] = 0xff; + buf[4] = 0xff; + buf[5] = 0x12; /* link local scope */ + buf[6] = 0x60; /* IPv6 signature */ + buf[7] = 0x1b; + buf[8] = 0; /* P_Key */ + buf[9] = 0; + memcpy(buf + 10, addr->s6_addr + 6, 10); +} #endif #endif diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index e1003256c641..5fa3fdb890e4 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -1095,6 +1096,12 @@ static int ipv6_generate_eui64(u8 *eui, struct net_device *dev) memset(eui, 0, 7); eui[7] = *(u8*)dev->dev_addr; return 0; + case ARPHRD_INFINIBAND: + if (dev->addr_len != INFINIBAND_ALEN) + return -1; + memcpy(eui, dev->dev_addr + 12, 8); + eui[0] |= 2; + return 0; } return -1; } @@ -1794,7 +1801,8 @@ static void addrconf_dev_config(struct net_device *dev) if ((dev->type != ARPHRD_ETHER) && (dev->type != ARPHRD_FDDI) && (dev->type != ARPHRD_IEEE802_TR) && - (dev->type != ARPHRD_ARCNET)) { + (dev->type != ARPHRD_ARCNET) && + (dev->type != ARPHRD_INFINIBAND)) { /* Alas, we support only Ethernet autoconfiguration. */ return; } diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index d4eaaa8245a4..55110651a3f2 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c @@ -260,6 +260,9 @@ int ndisc_mc_map(struct in6_addr *addr, char *buf, struct net_device *dev, int d case ARPHRD_ARCNET: ipv6_arcnet_mc_map(addr, buf); return 0; + case ARPHRD_INFINIBAND: + ipv6_ib_mc_map(addr, buf); + return 0; default: if (dir) { memcpy(buf, dev->broadcast, dev->addr_len); -- cgit v1.2.3