summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-12-28 19:06:28 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-12-28 19:06:28 -0800
commit1c9a512c3de2d3cf0697ceae110595ea4de9ecbb (patch)
treef9afca047a64b963b5b74ac61a03fdae384fca43 /net
parentd70e75637caeba4bfb5c35ed16379d0e4c1a2b68 (diff)
parent7faf92a451f2dc9c086c48bbfa9f069bed748248 (diff)
Merge bk://kernel.bkbits.net/davem/net-2.6
into ppc970.osdl.org:/home/torvalds/v2.6/linux
Diffstat (limited to 'net')
-rw-r--r--net/appletalk/aarp.c4
-rw-r--r--net/appletalk/atalk_proc.c6
-rw-r--r--net/appletalk/ddp.c6
-rw-r--r--net/ax25/af_ax25.c2
-rw-r--r--net/ax25/ax25_addr.c20
-rw-r--r--net/ax25/ax25_ds_subr.c2
-rw-r--r--net/ethernet/eth.c2
-rw-r--r--net/ipv4/Kconfig5
-rw-r--r--net/ipv4/af_inet.c18
-rw-r--r--net/ipv4/arp.c11
-rw-r--r--net/ipv4/datagram.c2
-rw-r--r--net/ipv4/devinet.c4
-rw-r--r--net/ipv4/fib_frontend.c6
-rw-r--r--net/ipv4/fib_rules.c8
-rw-r--r--net/ipv4/icmp.c8
-rw-r--r--net/ipv4/igmp.c32
-rw-r--r--net/ipv4/ip_gre.c6
-rw-r--r--net/ipv4/ip_output.c16
-rw-r--r--net/ipv4/ip_sockglue.c14
-rw-r--r--net/ipv4/ipconfig.c12
-rw-r--r--net/ipv4/ipvs/ip_vs_app.c2
-rw-r--r--net/ipv4/ipvs/ip_vs_conn.c2
-rw-r--r--net/ipv4/ipvs/ip_vs_ctl.c2
-rw-r--r--net/ipv4/ipvs/ip_vs_proto.c4
-rw-r--r--net/ipv4/ipvs/ip_vs_proto_icmp.c4
-rw-r--r--net/ipv4/ipvs/ip_vs_sync.c6
-rw-r--r--net/ipv4/netfilter/ip_conntrack_core.c2
-rw-r--r--net/ipv4/raw.c18
-rw-r--r--net/ipv4/route.c32
-rw-r--r--net/ipv4/tcp.c4
-rw-r--r--net/ipv4/tcp_diag.c14
-rw-r--r--net/ipv4/tcp_input.c18
-rw-r--r--net/ipv4/tcp_ipv4.c32
-rw-r--r--net/ipv4/tcp_minisocks.c6
-rw-r--r--net/ipv4/tcp_output.c2
-rw-r--r--net/ipv4/tcp_timer.c5
-rw-r--r--net/ipv4/udp.c33
-rw-r--r--net/ipv4/xfrm4_policy.c7
-rw-r--r--net/ipv6/addrconf.c10
-rw-r--r--net/ipv6/af_inet6.c10
-rw-r--r--net/ipv6/datagram.c4
-rw-r--r--net/ipv6/ip6_output.c6
-rw-r--r--net/ipv6/ndisc.c3
-rw-r--r--net/ipv6/raw.c10
-rw-r--r--net/ipv6/tcp_ipv6.c20
-rw-r--r--net/ipv6/udp.c12
-rw-r--r--net/ipx/af_ipx.c10
-rw-r--r--net/ipx/ipx_proc.c6
-rw-r--r--net/irda/af_irda.c4
-rw-r--r--net/irda/discovery.c35
-rw-r--r--net/irda/ircomm/ircomm_core.c4
-rw-r--r--net/irda/ircomm/ircomm_event.c2
-rw-r--r--net/irda/ircomm/ircomm_lmp.c128
-rw-r--r--net/irda/ircomm/ircomm_param.c17
-rw-r--r--net/irda/ircomm/ircomm_ttp.c84
-rw-r--r--net/irda/ircomm/ircomm_tty.c7
-rw-r--r--net/irda/ircomm/ircomm_tty_attach.c12
-rw-r--r--net/irda/ircomm/ircomm_tty_ioctl.c2
-rw-r--r--net/irda/irda_device.c70
-rw-r--r--net/irda/iriap.c51
-rw-r--r--net/irda/irias_object.c6
-rw-r--r--net/irda/irlan/irlan_client.c41
-rw-r--r--net/irda/irlan/irlan_common.c32
-rw-r--r--net/irda/irlan/irlan_provider.c6
-rw-r--r--net/irda/irlap.c8
-rw-r--r--net/irda/irlap_event.c2
-rw-r--r--net/irda/irlap_frame.c35
-rw-r--r--net/irda/irlmp.c12
-rw-r--r--net/irda/irmod.c4
-rw-r--r--net/irda/irnet/irnet.h6
-rw-r--r--net/irda/irnet/irnet_ppp.c8
-rw-r--r--net/irda/irnet/irnet_ppp.h7
-rw-r--r--net/irda/irsysctl.c1
-rw-r--r--net/irda/irttp.c12
-rw-r--r--net/irda/parameters.c11
-rw-r--r--net/irda/qos.c25
-rw-r--r--net/key/af_key.c2
-rw-r--r--net/llc/llc_c_ac.c127
-rw-r--r--net/llc/llc_c_ev.c88
-rw-r--r--net/llc/llc_conn.c7
-rw-r--r--net/llc/llc_core.c6
-rw-r--r--net/llc/llc_if.c24
-rw-r--r--net/llc/llc_pdu.c13
-rw-r--r--net/llc/llc_proc.c4
-rw-r--r--net/llc/llc_sap.c5
-rw-r--r--net/llc/llc_station.c2
-rw-r--r--net/netlink/af_netlink.c28
-rw-r--r--net/netrom/af_netrom.c2
-rw-r--r--net/netrom/nr_route.c5
-rw-r--r--net/packet/af_packet.c21
-rw-r--r--net/rose/af_rose.c2
-rw-r--r--net/rose/rose_dev.c32
-rw-r--r--net/rose/rose_link.c39
-rw-r--r--net/rose/rose_route.c4
-rw-r--r--net/rose/rose_subr.c4
-rw-r--r--net/rxrpc/call.c15
-rw-r--r--net/rxrpc/connection.c4
-rw-r--r--net/rxrpc/internal.h3
-rw-r--r--net/rxrpc/peer.c4
-rw-r--r--net/rxrpc/rxrpc_syms.c1
-rw-r--r--net/rxrpc/transport.c10
-rw-r--r--net/sched/gact.c2
-rw-r--r--net/sched/police.c38
-rw-r--r--net/sched/sch_api.c11
-rw-r--r--net/sched/sch_dsmark.c9
-rw-r--r--net/sched/sch_generic.c4
-rw-r--r--net/sched/sch_htb.c2
-rw-r--r--net/sched/sch_ingress.c2
-rw-r--r--net/sched/sch_prio.c3
-rw-r--r--net/sctp/input.c2
-rw-r--r--net/sctp/ipv6.c6
-rw-r--r--net/sctp/protocol.c4
-rw-r--r--net/socket.c5
-rw-r--r--net/sunrpc/auth.c2
-rw-r--r--net/sunrpc/auth_gss/auth_gss.c2
-rw-r--r--net/sunrpc/auth_gss/gss_generic_token.c35
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_crypto.c2
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_mech.c3
-rw-r--r--net/sunrpc/auth_gss/gss_pseudoflavors.c237
-rw-r--r--net/sunrpc/auth_gss/gss_spkm3_mech.c9
-rw-r--r--net/sunrpc/auth_gss/sunrpcgss_syms.c37
-rw-r--r--net/sunrpc/auth_gss/svcauth_gss.c4
-rw-r--r--net/sunrpc/cache.c41
-rw-r--r--net/sunrpc/pmap_clnt.c4
-rw-r--r--net/sunrpc/rpc_pipe.c9
-rw-r--r--net/sunrpc/sched.c5
-rw-r--r--net/sunrpc/sunrpc_syms.c1
-rw-r--r--net/sunrpc/svcauth.c3
-rw-r--r--net/sunrpc/svcauth_des.c215
-rw-r--r--net/sunrpc/svcauth_unix.c6
-rw-r--r--net/sunrpc/xdr.c133
-rw-r--r--net/sunrpc/xprt.c8
-rw-r--r--net/unix/af_unix.c2
-rw-r--r--net/unix/sysctl_net_unix.c2
-rw-r--r--net/x25/af_x25.c8
-rw-r--r--net/x25/x25_dev.c23
-rw-r--r--net/x25/x25_link.c33
-rw-r--r--net/x25/x25_proc.c4
-rw-r--r--net/xfrm/xfrm_algo.c8
-rw-r--r--net/xfrm/xfrm_export.c1
-rw-r--r--net/xfrm/xfrm_policy.c8
-rw-r--r--net/xfrm/xfrm_state.c7
-rw-r--r--net/xfrm/xfrm_user.c4
143 files changed, 668 insertions, 1828 deletions
diff --git a/net/appletalk/aarp.c b/net/appletalk/aarp.c
index 8383c1d581cd..cd888bcf67d7 100644
--- a/net/appletalk/aarp.c
+++ b/net/appletalk/aarp.c
@@ -199,7 +199,7 @@ static void aarp_send_reply(struct net_device *dev, struct atalk_addr *us,
* aarp_proxy_probe_network.
*/
-void aarp_send_probe(struct net_device *dev, struct atalk_addr *us)
+static void aarp_send_probe(struct net_device *dev, struct atalk_addr *us)
{
struct elapaarp *eah;
int len = dev->hard_header_len + sizeof(*eah) + aarp_dl->header_length;
@@ -429,7 +429,7 @@ static struct atalk_addr *__aarp_proxy_find(struct net_device *dev,
* Probe a Phase 1 device or a device that requires its Net:Node to
* be set via an ioctl.
*/
-void aarp_send_probe_phase1(struct atalk_iface *iface)
+static void aarp_send_probe_phase1(struct atalk_iface *iface)
{
struct ifreq atreq;
struct sockaddr_at *sa = (struct sockaddr_at *)&atreq.ifr_addr;
diff --git a/net/appletalk/atalk_proc.c b/net/appletalk/atalk_proc.c
index 4d20501fad77..dc4048dd98c1 100644
--- a/net/appletalk/atalk_proc.c
+++ b/net/appletalk/atalk_proc.c
@@ -205,21 +205,21 @@ out:
return 0;
}
-struct seq_operations atalk_seq_interface_ops = {
+static struct seq_operations atalk_seq_interface_ops = {
.start = atalk_seq_interface_start,
.next = atalk_seq_interface_next,
.stop = atalk_seq_interface_stop,
.show = atalk_seq_interface_show,
};
-struct seq_operations atalk_seq_route_ops = {
+static struct seq_operations atalk_seq_route_ops = {
.start = atalk_seq_route_start,
.next = atalk_seq_route_next,
.stop = atalk_seq_route_stop,
.show = atalk_seq_route_show,
};
-struct seq_operations atalk_seq_socket_ops = {
+static struct seq_operations atalk_seq_socket_ops = {
.start = atalk_seq_socket_start,
.next = atalk_seq_socket_next,
.stop = atalk_seq_socket_stop,
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index 14a7a0198313..d903b5070f06 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -612,7 +612,7 @@ out:
* Called when a device is downed. Just throw away any routes
* via it.
*/
-void atrtr_device_down(struct net_device *dev)
+static void atrtr_device_down(struct net_device *dev)
{
struct atalk_route **r = &atalk_routes;
struct atalk_route *tmp;
@@ -1854,12 +1854,12 @@ static struct notifier_block ddp_notifier = {
.notifier_call = ddp_device_event,
};
-struct packet_type ltalk_packet_type = {
+static struct packet_type ltalk_packet_type = {
.type = __constant_htons(ETH_P_LOCALTALK),
.func = ltalk_rcv,
};
-struct packet_type ppptalk_packet_type = {
+static struct packet_type ppptalk_packet_type = {
.type = __constant_htons(ETH_P_PPPTALK),
.func = atalk_rcv,
};
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
@@ -121,26 +121,6 @@ int ax25cmp(ax25_address *a, ax25_address *b)
}
/*
- * 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;
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);
diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig
index f3721ac39144..8fe95800fe83 100644
--- a/net/ipv4/Kconfig
+++ b/net/ipv4/Kconfig
@@ -355,7 +355,10 @@ config IP_TCPDIAG
default y
---help---
Support for TCP socket monitoring interface used by native Linux
- tools such as ss.
+ tools such as ss. ss is included in iproute2, currently downloadable
+ at <http://developer.osdl.org/dev/iproute2>. If you want IPv6 support
+ and have selected IPv6 as a module, you need to build this as a
+ module too.
If unsure, say Y.
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 56872058ebce..4ec92ccca253 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;
@@ -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..9b4b93364164 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);
@@ -704,7 +707,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 +964,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 +1078,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 +1210,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/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/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..dc2e14faedb8 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;
@@ -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..1f3183168a90 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;
@@ -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))
@@ -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;
@@ -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_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_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..ee4e03628465 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;
@@ -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/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/ipvs/ip_vs_app.c b/net/ipv4/ipvs/ip_vs_app.c
index 9c00cf358d0d..d9212addd193 100644
--- a/net/ipv4/ipvs/ip_vs_app.c
+++ b/net/ipv4/ipvs/ip_vs_app.c
@@ -65,7 +65,7 @@ static inline void ip_vs_app_put(struct ip_vs_app *app)
/*
* Allocate/initialize app incarnation and register it in proto apps.
*/
-int
+static int
ip_vs_app_inc_new(struct ip_vs_app *app, __u16 proto, __u16 port)
{
struct ip_vs_protocol *pp;
diff --git a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c
index 95f4568f8afa..fd6feb5499fe 100644
--- a/net/ipv4/ipvs/ip_vs_conn.c
+++ b/net/ipv4/ipvs/ip_vs_conn.c
@@ -64,7 +64,7 @@ struct ip_vs_aligned_lock
} __attribute__((__aligned__(SMP_CACHE_BYTES)));
/* lock array for conn table */
-struct ip_vs_aligned_lock
+static struct ip_vs_aligned_lock
__ip_vs_conntbl_lock_array[CT_LOCKARRAY_SIZE] __cacheline_aligned;
static inline void ct_read_lock(unsigned key)
diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c
index 47388b29affd..dc00cccca423 100644
--- a/net/ipv4/ipvs/ip_vs_ctl.c
+++ b/net/ipv4/ipvs/ip_vs_ctl.c
@@ -62,7 +62,7 @@ static spinlock_t __ip_vs_droppacket_lock = SPIN_LOCK_UNLOCKED;
/* 1/rate drop and drop-entry variables */
int ip_vs_drop_rate = 0;
int ip_vs_drop_counter = 0;
-atomic_t ip_vs_dropentry = ATOMIC_INIT(0);
+static atomic_t ip_vs_dropentry = ATOMIC_INIT(0);
/* number of virtual services */
static int ip_vs_num_services = 0;
diff --git a/net/ipv4/ipvs/ip_vs_proto.c b/net/ipv4/ipvs/ip_vs_proto.c
index dfd0a7dd3b75..253c46252bd5 100644
--- a/net/ipv4/ipvs/ip_vs_proto.c
+++ b/net/ipv4/ipvs/ip_vs_proto.c
@@ -45,7 +45,7 @@ static struct ip_vs_protocol *ip_vs_proto_table[IP_VS_PROTO_TAB_SIZE];
/*
* register an ipvs protocol
*/
-int register_ip_vs_protocol(struct ip_vs_protocol *pp)
+static int register_ip_vs_protocol(struct ip_vs_protocol *pp)
{
unsigned hash = IP_VS_PROTO_HASH(pp->protocol);
@@ -62,7 +62,7 @@ int register_ip_vs_protocol(struct ip_vs_protocol *pp)
/*
* unregister an ipvs protocol
*/
-int unregister_ip_vs_protocol(struct ip_vs_protocol *pp)
+static int unregister_ip_vs_protocol(struct ip_vs_protocol *pp)
{
struct ip_vs_protocol **pp_p;
unsigned hash = IP_VS_PROTO_HASH(pp->protocol);
diff --git a/net/ipv4/ipvs/ip_vs_proto_icmp.c b/net/ipv4/ipvs/ip_vs_proto_icmp.c
index 747e0333f5de..191e94aa1c1f 100644
--- a/net/ipv4/ipvs/ip_vs_proto_icmp.c
+++ b/net/ipv4/ipvs/ip_vs_proto_icmp.c
@@ -22,7 +22,7 @@ static int icmp_timeouts[1] = { 1*60*HZ };
static char * icmp_state_name_table[1] = { "ICMP" };
-struct ip_vs_conn *
+static struct ip_vs_conn *
icmp_conn_in_get(const struct sk_buff *skb,
struct ip_vs_protocol *pp,
const struct iphdr *iph,
@@ -49,7 +49,7 @@ icmp_conn_in_get(const struct sk_buff *skb,
#endif
}
-struct ip_vs_conn *
+static struct ip_vs_conn *
icmp_conn_out_get(const struct sk_buff *skb,
struct ip_vs_protocol *pp,
const struct iphdr *iph,
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..c6294ee6f42e 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;
@@ -562,10 +562,10 @@ 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);
+ 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/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.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..15c906067266 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),
@@ -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_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..1e0970332a21 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)
@@ -337,7 +339,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. */
@@ -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_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..48fca593c24e 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);
@@ -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..078db102c0a6 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 &&
@@ -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;
@@ -227,7 +228,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);
@@ -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;
@@ -285,7 +287,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 +318,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 +400,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 +482,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;
@@ -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,10 +773,10 @@ 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 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 +867,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 +1506,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/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();
-}
-
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 <linux/netdevice.h>
#include <linux/if_arp.h>
#include <linux/if_arcnet.h>
+#include <linux/if_infiniband.h>
#include <linux/route.h>
#include <linux/inetdevice.h>
#include <linux/init.h>
@@ -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/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/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);
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/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,
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 <net/irda/ircomm_event.h>
#include <net/irda/ircomm_lmp.h>
-/*
- * 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(&notify);
- 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, &notify, 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(&notify);
+ 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, &notify, 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
@@ -92,23 +92,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)
*
* Queue a parameter for the control channel
diff --git a/net/irda/ircomm/ircomm_ttp.c b/net/irda/ircomm/ircomm_ttp.c
index fc453c3ad55e..6dafe0b0f628 100644
--- a/net/irda/ircomm/ircomm_ttp.c
+++ b/net/irda/ircomm/ircomm_ttp.c
@@ -40,6 +40,35 @@
#include <net/irda/ircomm_event.h>
#include <net/irda/ircomm_ttp.h>
+static int ircomm_ttp_data_indication(void *instance, void *sap,
+ struct sk_buff *skb);
+static 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);
+static 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);
+static void ircomm_ttp_flow_indication(void *instance, void *sap,
+ LOCAL_FLOW cmd);
+static void ircomm_ttp_disconnect_indication(void *instance, void *sap,
+ LM_REASON reason,
+ struct sk_buff *skb);
+static int ircomm_ttp_data_request(struct ircomm_cb *self,
+ struct sk_buff *skb,
+ int clen);
+static int ircomm_ttp_connect_request(struct ircomm_cb *self,
+ struct sk_buff *userdata,
+ struct ircomm_info *info);
+static int ircomm_ttp_connect_response(struct ircomm_cb *self,
+ struct sk_buff *userdata);
+static int ircomm_ttp_disconnect_request(struct ircomm_cb *self,
+ struct sk_buff *userdata,
+ struct ircomm_info *info);
+
/*
* Function ircomm_open_tsap (self)
*
@@ -87,9 +116,9 @@ 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)
+static int ircomm_ttp_connect_request(struct ircomm_cb *self,
+ struct sk_buff *userdata,
+ struct ircomm_info *info)
{
int ret = 0;
@@ -112,8 +141,8 @@ int ircomm_ttp_connect_request(struct ircomm_cb *self,
*
*
*/
-int ircomm_ttp_connect_response(struct ircomm_cb *self,
- struct sk_buff *userdata)
+static int ircomm_ttp_connect_response(struct ircomm_cb *self,
+ struct sk_buff *userdata)
{
int ret;
@@ -137,9 +166,9 @@ int ircomm_ttp_connect_response(struct ircomm_cb *self,
* some of them are sent after connection establishment, so this can
* increase the latency a bit.
*/
-int ircomm_ttp_data_request(struct ircomm_cb *self,
- struct sk_buff *skb,
- int clen)
+static int ircomm_ttp_data_request(struct ircomm_cb *self,
+ struct sk_buff *skb,
+ int clen)
{
int ret;
@@ -175,8 +204,8 @@ int ircomm_ttp_data_request(struct ircomm_cb *self,
* Incoming data
*
*/
-int ircomm_ttp_data_indication(void *instance, void *sap,
- struct sk_buff *skb)
+static int ircomm_ttp_data_indication(void *instance, void *sap,
+ struct sk_buff *skb)
{
struct ircomm_cb *self = (struct ircomm_cb *) instance;
@@ -194,11 +223,11 @@ int ircomm_ttp_data_indication(void *instance, void *sap,
return 0;
}
-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)
+static 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)
{
struct ircomm_cb *self = (struct ircomm_cb *) instance;
struct ircomm_info info;
@@ -234,11 +263,11 @@ out:
*
*
*/
-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)
+static 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)
{
struct ircomm_cb *self = (struct ircomm_cb *)instance;
struct ircomm_info info;
@@ -273,9 +302,9 @@ out:
*
*
*/
-int ircomm_ttp_disconnect_request(struct ircomm_cb *self,
- struct sk_buff *userdata,
- struct ircomm_info *info)
+static int ircomm_ttp_disconnect_request(struct ircomm_cb *self,
+ struct sk_buff *userdata,
+ struct ircomm_info *info)
{
int ret;
@@ -294,9 +323,9 @@ int ircomm_ttp_disconnect_request(struct ircomm_cb *self,
*
*
*/
-void ircomm_ttp_disconnect_indication(void *instance, void *sap,
- LM_REASON reason,
- struct sk_buff *skb)
+static void ircomm_ttp_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;
@@ -321,7 +350,8 @@ void ircomm_ttp_disconnect_indication(void *instance, void *sap,
* Layer below is telling us to start or stop the flow of data
*
*/
-void ircomm_ttp_flow_indication(void *instance, void *sap, LOCAL_FLOW cmd)
+static void ircomm_ttp_flow_indication(void *instance, void *sap,
+ LOCAL_FLOW cmd)
{
struct ircomm_cb *self = (struct ircomm_cb *) instance;
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;
@@ -309,42 +310,6 @@ static void irlan_client_ctrl_connect_confirm(void *instance, void *sap,
}
/*
- * 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)
*
* Print return code of request to peer IrLAN layer.
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 <net/irda/irlap_frame.h>
#include <net/irda/qos.h>
+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 <net/irda/irlmp.h>
#include <net/irda/irlmp_frame.h>
+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..9004f7349a76 100644
--- a/net/irda/irnet/irnet.h
+++ b/net/irda/irnet/irnet.h
@@ -363,13 +363,13 @@
/* Exit a function with debug */
#define DRETURN(ret, dbg, args...) \
{DEXIT(dbg, ": " args);\
- return(ret); }
+ return ret; }
/* Exit a function on failed condition */
#define DABORT(cond, ret, dbg, args...) \
{if(cond) {\
DERROR(dbg, args);\
- return(ret); }}
+ return ret; }}
/* Invalid assertion, print out an error and exit... */
#define DASSERT(cond, ret, dbg, args...) \
@@ -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)
{
diff --git a/net/key/af_key.c b/net/key/af_key.c
index ed9d9bebdd35..cc4a9c8c038c 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -35,7 +35,7 @@
/* List of all pfkey sockets. */
-HLIST_HEAD(pfkey_table);
+static HLIST_HEAD(pfkey_table);
static DECLARE_WAIT_QUEUE_HEAD(pfkey_table_wait);
static rwlock_t pfkey_table_lock = RW_LOCK_UNLOCKED;
static atomic_t pfkey_table_users = ATOMIC_INIT(0);
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..0b737bd77062 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);
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
@@ -80,19 +80,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
* @p_bit: The P bit to set in the PDU
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);
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
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
index 62ff798bf306..8576b42ce7fa 100644
--- a/net/netrom/af_netrom.c
+++ b/net/netrom/af_netrom.c
@@ -43,7 +43,7 @@
#include <net/arp.h>
#include <linux/init.h>
-int nr_ndevs = 4;
+static int nr_ndevs = 4;
int sysctl_netrom_default_path_quality = NR_DEFAULT_QUAL;
int sysctl_netrom_obsolescence_count_initialiser = NR_DEFAULT_OBS;
diff --git a/net/netrom/nr_route.c b/net/netrom/nr_route.c
index f667a29e1a07..d39549eb2fdd 100644
--- a/net/netrom/nr_route.c
+++ b/net/netrom/nr_route.c
@@ -45,7 +45,7 @@ static spinlock_t nr_node_list_lock = SPIN_LOCK_UNLOCKED;
static HLIST_HEAD(nr_neigh_list);
static spinlock_t nr_neigh_list_lock = SPIN_LOCK_UNLOCKED;
-struct nr_node *nr_node_get(ax25_address *callsign)
+static struct nr_node *nr_node_get(ax25_address *callsign)
{
struct nr_node *found = NULL;
struct nr_node *nr_node;
@@ -62,7 +62,8 @@ struct nr_node *nr_node_get(ax25_address *callsign)
return found;
}
-struct nr_neigh *nr_neigh_get_dev(ax25_address *callsign, struct net_device *dev)
+static struct nr_neigh *nr_neigh_get_dev(ax25_address *callsign,
+ struct net_device *dev)
{
struct nr_neigh *found = NULL;
struct nr_neigh *nr_neigh;
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 31bce98d6760..60e6d827436b 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -145,10 +145,10 @@ dev->hard_header == NULL (ll header is added by device, we cannot control it)
*/
/* List of all packet sockets. */
-HLIST_HEAD(packet_sklist);
+static HLIST_HEAD(packet_sklist);
static rwlock_t packet_sklist_lock = RW_LOCK_UNLOCKED;
-atomic_t packet_socks_nr;
+static atomic_t packet_socks_nr;
/* Private packet socket structures. */
@@ -215,7 +215,7 @@ static inline char *packet_lookup_frame(struct packet_opt *po, unsigned int posi
#define pkt_sk(__sk) ((struct packet_opt *)(__sk)->sk_protinfo)
-void packet_sock_destruct(struct sock *sk)
+static void packet_sock_destruct(struct sock *sk)
{
BUG_TRAP(!atomic_read(&sk->sk_rmem_alloc));
BUG_TRAP(!atomic_read(&sk->sk_wmem_alloc));
@@ -234,10 +234,10 @@ void packet_sock_destruct(struct sock *sk)
}
-extern struct proto_ops packet_ops;
+static struct proto_ops packet_ops;
#ifdef CONFIG_SOCK_PACKET
-extern struct proto_ops packet_ops_spkt;
+static struct proto_ops packet_ops_spkt;
static int packet_rcv_spkt(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
{
@@ -1350,8 +1350,8 @@ packet_setsockopt(struct socket *sock, int level, int optname, char __user *optv
}
}
-int packet_getsockopt(struct socket *sock, int level, int optname,
- char __user *optval, int __user *optlen)
+static int packet_getsockopt(struct socket *sock, int level, int optname,
+ char __user *optval, int __user *optlen)
{
int len;
struct sock *sk = sock->sk;
@@ -1500,7 +1500,8 @@ static int packet_ioctl(struct socket *sock, unsigned int cmd,
#define packet_poll datagram_poll
#else
-unsigned int packet_poll(struct file * file, struct socket *sock, poll_table *wait)
+static unsigned int packet_poll(struct file * file, struct socket *sock,
+ poll_table *wait)
{
struct sock *sk = sock->sk;
struct packet_opt *po = pkt_sk(sk);
@@ -1747,7 +1748,7 @@ out:
#ifdef CONFIG_SOCK_PACKET
-struct proto_ops packet_ops_spkt = {
+static struct proto_ops packet_ops_spkt = {
.family = PF_PACKET,
.owner = THIS_MODULE,
.release = packet_release,
@@ -1769,7 +1770,7 @@ struct proto_ops packet_ops_spkt = {
};
#endif
-struct proto_ops packet_ops = {
+static struct proto_ops packet_ops = {
.family = PF_PACKET,
.owner = THIS_MODULE,
.release = packet_release,
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 <net/ax25.h>
#include <net/rose.h>
-/*
- * 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;
@@ -219,34 +222,6 @@ void rose_transmit_restart_confirmation(struct rose_neigh *neigh)
}
/*
- * 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 <linux/interrupt.h>
#include <net/rose.h>
+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;
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
@@ -150,16 +150,6 @@ int rxrpc_create_transport(unsigned short port,
/*****************************************************************************/
/*
- * 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
*/
void rxrpc_put_transport(struct rxrpc_transport *trans)
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 96da96b628fd..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;
@@ -180,7 +180,8 @@ int tcf_act_police_locate(struct rtattr *rta, struct rtattr *est,struct tc_actio
if (rtattr_parse(tb, TCA_POLICE_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0)
return -1;
- if (tb[TCA_POLICE_TBF-1] == NULL)
+ if (tb[TCA_POLICE_TBF-1] == NULL ||
+ RTA_PAYLOAD(tb[TCA_POLICE_TBF-1]) != sizeof(*parm))
return -1;
parm = RTA_DATA(tb[TCA_POLICE_TBF-1]);
@@ -220,11 +221,17 @@ override:
goto failure;
}
}
- if (tb[TCA_POLICE_RESULT-1])
- p->result = *(int*)RTA_DATA(tb[TCA_POLICE_RESULT-1]);
+ if (tb[TCA_POLICE_RESULT-1]) {
+ if (RTA_PAYLOAD(tb[TCA_POLICE_RESULT-1]) != sizeof(u32))
+ goto failure;
+ p->result = *(u32*)RTA_DATA(tb[TCA_POLICE_RESULT-1]);
+ }
#ifdef CONFIG_NET_ESTIMATOR
- if (tb[TCA_POLICE_AVRATE-1])
+ if (tb[TCA_POLICE_AVRATE-1]) {
+ if (RTA_PAYLOAD(tb[TCA_POLICE_AVRATE-1]) != sizeof(u32))
+ goto failure;
p->ewma_rate = *(u32*)RTA_DATA(tb[TCA_POLICE_AVRATE-1]);
+ }
#endif
p->toks = p->burst = parm->burst;
p->mtu = parm->mtu;
@@ -265,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);
@@ -275,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;
@@ -338,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;
@@ -424,7 +431,8 @@ struct tcf_police * tcf_police_locate(struct rtattr *rta, struct rtattr *est)
if (rtattr_parse(tb, TCA_POLICE_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0)
return NULL;
- if (tb[TCA_POLICE_TBF-1] == NULL)
+ if (tb[TCA_POLICE_TBF-1] == NULL ||
+ RTA_PAYLOAD(tb[TCA_POLICE_TBF-1]) != sizeof(*parm))
return NULL;
parm = RTA_DATA(tb[TCA_POLICE_TBF-1]);
@@ -449,11 +457,17 @@ struct tcf_police * tcf_police_locate(struct rtattr *rta, struct rtattr *est)
(p->P_tab = qdisc_get_rtab(&parm->peakrate, tb[TCA_POLICE_PEAKRATE-1])) == NULL)
goto failure;
}
- if (tb[TCA_POLICE_RESULT-1])
- p->result = *(int*)RTA_DATA(tb[TCA_POLICE_RESULT-1]);
+ if (tb[TCA_POLICE_RESULT-1]) {
+ if (RTA_PAYLOAD(tb[TCA_POLICE_RESULT-1]) != sizeof(u32))
+ goto failure;
+ p->result = *(u32*)RTA_DATA(tb[TCA_POLICE_RESULT-1]);
+ }
#ifdef CONFIG_NET_ESTIMATOR
- if (tb[TCA_POLICE_AVRATE-1])
+ if (tb[TCA_POLICE_AVRATE-1]) {
+ if (RTA_PAYLOAD(tb[TCA_POLICE_AVRATE-1]) != sizeof(u32))
+ goto failure;
p->ewma_rate = *(u32*)RTA_DATA(tb[TCA_POLICE_AVRATE-1]);
+ }
#endif
p->toks = p->burst = parm->burst;
p->mtu = parm->mtu;
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..19f4e4fa7f48 100644
--- a/net/sched/sch_dsmark.c
+++ b/net/sched/sch_dsmark.c
@@ -14,6 +14,7 @@
#include <linux/rtnetlink.h>
#include <net/pkt_sched.h>
#include <net/dsfield.h>
+#include <net/inet_ecn.h>
#include <asm/byteorder.h>
@@ -198,10 +199,12 @@ static int dsmark_enqueue(struct sk_buff *skb,struct Qdisc *sch)
/* FIXME: Safe with non-linear skbs? --RR */
switch (skb->protocol) {
case __constant_htons(ETH_P_IP):
- skb->tc_index = ipv4_get_dsfield(skb->nh.iph);
+ skb->tc_index = ipv4_get_dsfield(skb->nh.iph)
+ & ~INET_ECN_MASK;
break;
case __constant_htons(ETH_P_IPV6):
- skb->tc_index = ipv6_get_dsfield(skb->nh.ipv6h);
+ skb->tc_index = ipv6_get_dsfield(skb->nh.ipv6h)
+ & ~INET_ECN_MASK;
break;
default:
skb->tc_index = 0;
@@ -320,7 +323,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;
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/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;
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_pseudoflavors.c b/net/sunrpc/auth_gss/gss_pseudoflavors.c
deleted file mode 100644
index e7b9aa9c9c90..000000000000
--- a/net/sunrpc/auth_gss/gss_pseudoflavors.c
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * linux/net/sunrpc/gss_union.c
- *
- * Adapted from MIT Kerberos 5-1.2.1 lib/gssapi/generic code
- *
- * Copyright (c) 2001 The Regents of the University of Michigan.
- * All rights reserved.
- *
- * Andy Adamson <andros@umich.edu>
- *
- */
-
-/*
- * Copyright 1993 by OpenVision Technologies, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appears in all copies and
- * that both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of OpenVision not be used
- * in advertising or publicity pertaining to distribution of the software
- * without specific, written prior permission. OpenVision makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
- * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include <linux/types.h>
-#include <linux/slab.h>
-#include <linux/socket.h>
-#include <linux/sunrpc/gss_asn1.h>
-#include <linux/sunrpc/auth_gss.h>
-
-#ifdef RPC_DEBUG
-# define RPCDBG_FACILITY RPCDBG_AUTH
-#endif
-
-static LIST_HEAD(registered_triples);
-static spinlock_t registered_triples_lock = SPIN_LOCK_UNLOCKED;
-
-/* The following must be called with spinlock held: */
-static struct sup_sec_triple *
-do_lookup_triple_by_pseudoflavor(u32 pseudoflavor)
-{
- struct sup_sec_triple *pos, *triple = NULL;
-
- list_for_each_entry(pos, &registered_triples, triples) {
- if (pos->pseudoflavor == pseudoflavor) {
- triple = pos;
- break;
- }
- }
- return triple;
-}
-
-/* XXX Need to think about reference counting of triples and of mechs.
- * Currently we do no reference counting of triples, and I think that's
- * probably OK given the reference counting on mechs, but there's probably
- * a better way to do all this. */
-
-int
-gss_register_triple(u32 pseudoflavor, struct gss_api_mech *mech,
- u32 qop, u32 service)
-{
- struct sup_sec_triple *triple;
-
- if (!(triple = kmalloc(sizeof(*triple), GFP_KERNEL))) {
- printk("Alloc failed in gss_register_triple");
- goto err;
- }
- triple->pseudoflavor = pseudoflavor;
- triple->mech = gss_mech_get_by_OID(&mech->gm_oid);
- triple->qop = qop;
- triple->service = service;
-
- spin_lock(&registered_triples_lock);
- if (do_lookup_triple_by_pseudoflavor(pseudoflavor)) {
- printk(KERN_WARNING "RPC: Registered pseudoflavor %d again\n",
- pseudoflavor);
- goto err_unlock;
- }
- list_add(&triple->triples, &registered_triples);
- spin_unlock(&registered_triples_lock);
- dprintk("RPC: registered pseudoflavor %d\n", pseudoflavor);
-
- return 0;
-
-err_unlock:
- kfree(triple);
- spin_unlock(&registered_triples_lock);
-err:
- return -1;
-}
-
-int
-gss_unregister_triple(u32 pseudoflavor)
-{
- struct sup_sec_triple *triple;
-
- spin_lock(&registered_triples_lock);
- if (!(triple = do_lookup_triple_by_pseudoflavor(pseudoflavor))) {
- spin_unlock(&registered_triples_lock);
- printk("Can't unregister unregistered pseudoflavor %d\n",
- pseudoflavor);
- return -1;
- }
- list_del(&triple->triples);
- spin_unlock(&registered_triples_lock);
- gss_mech_put(triple->mech);
- kfree(triple);
- return 0;
-
-}
-
-void
-print_sec_triple(struct xdr_netobj *oid,u32 qop,u32 service)
-{
- dprintk("RPC: print_sec_triple:\n");
- dprintk(" oid_len %d\n oid :\n",oid->len);
- print_hexl((u32 *)oid->data,oid->len,0);
- dprintk(" qop %d\n",qop);
- dprintk(" service %d\n",service);
-}
-
-/* Function: gss_get_cmp_triples
- *
- * Description: search sec_triples for a matching security triple
- * return pseudoflavor if match, else 0
- * (Note that 0 is a valid pseudoflavor, but not for any gss pseudoflavor
- * (0 means auth_null), so this shouldn't cause confusion.)
- */
-u32
-gss_cmp_triples(u32 oid_len, char *oid_data, u32 qop, u32 service)
-{
- struct sup_sec_triple *triple;
- u32 pseudoflavor = 0;
- struct xdr_netobj oid;
-
- oid.len = oid_len;
- oid.data = oid_data;
-
- dprintk("RPC: gss_cmp_triples\n");
- print_sec_triple(&oid,qop,service);
-
- spin_lock(&registered_triples_lock);
- list_for_each_entry(triple, &registered_triples, triples) {
- if((g_OID_equal(&oid, &triple->mech->gm_oid))
- && (qop == triple->qop)
- && (service == triple->service)) {
- pseudoflavor = triple->pseudoflavor;
- break;
- }
- }
- spin_unlock(&registered_triples_lock);
- dprintk("RPC: gss_cmp_triples return %d\n", pseudoflavor);
- return pseudoflavor;
-}
-
-u32
-gss_get_pseudoflavor(struct gss_ctx *ctx, u32 qop, u32 service)
-{
- return gss_cmp_triples(ctx->mech_type->gm_oid.len,
- ctx->mech_type->gm_oid.data,
- qop, service);
-}
-
-/* Returns nonzero iff the given pseudoflavor is in the supported list.
- * (Note that without incrementing a reference count or anything, this
- * doesn't give any guarantees.) */
-int
-gss_pseudoflavor_supported(u32 pseudoflavor)
-{
- struct sup_sec_triple *triple;
-
- spin_lock(&registered_triples_lock);
- triple = do_lookup_triple_by_pseudoflavor(pseudoflavor);
- spin_unlock(&registered_triples_lock);
- return (triple ? 1 : 0);
-}
-
-u32
-gss_pseudoflavor_to_service(u32 pseudoflavor)
-{
- struct sup_sec_triple *triple;
-
- spin_lock(&registered_triples_lock);
- triple = do_lookup_triple_by_pseudoflavor(pseudoflavor);
- spin_unlock(&registered_triples_lock);
- if (!triple) {
- dprintk("RPC: gss_pseudoflavor_to_service called with unsupported pseudoflavor %d\n",
- pseudoflavor);
- return 0;
- }
- return triple->service;
-}
-
-struct gss_api_mech *
-gss_pseudoflavor_to_mech(u32 pseudoflavor) {
- struct sup_sec_triple *triple;
- struct gss_api_mech *mech = NULL;
-
- spin_lock(&registered_triples_lock);
- triple = do_lookup_triple_by_pseudoflavor(pseudoflavor);
- spin_unlock(&registered_triples_lock);
- if (triple)
- mech = gss_mech_get(triple->mech);
- else
- dprintk("RPC: gss_pseudoflavor_to_mech called with unsupported pseudoflavor %d\n",
- pseudoflavor);
- return mech;
-}
-
-int
-gss_pseudoflavor_to_mechOID(u32 pseudoflavor, struct xdr_netobj * oid)
-{
- struct gss_api_mech *mech;
-
- mech = gss_pseudoflavor_to_mech(pseudoflavor);
- if (!mech) {
- dprintk("RPC: gss_pseudoflavor_to_mechOID called with unsupported pseudoflavor %d\n",
- pseudoflavor);
- return -1;
- }
- oid->len = mech->gm_oid.len;
- if (!(oid->data = kmalloc(oid->len, GFP_KERNEL)))
- return -1;
- memcpy(oid->data, mech->gm_oid.data, oid->len);
- gss_mech_put(mech);
- return 0;
-}
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/sunrpcgss_syms.c b/net/sunrpc/auth_gss/sunrpcgss_syms.c
deleted file mode 100644
index ef45f93e5b95..000000000000
--- a/net/sunrpc/auth_gss/sunrpcgss_syms.c
+++ /dev/null
@@ -1,37 +0,0 @@
-#include <linux/config.h>
-#include <linux/module.h>
-
-#include <linux/types.h>
-#include <linux/socket.h>
-#include <linux/sched.h>
-#include <linux/uio.h>
-#include <linux/unistd.h>
-
-#include <linux/sunrpc/auth_gss.h>
-#include <linux/sunrpc/svcauth_gss.h>
-#include <linux/sunrpc/gss_asn1.h>
-#include <linux/sunrpc/gss_krb5.h>
-
-/* svcauth_gss.c: */
-EXPORT_SYMBOL(svcauth_gss_register_pseudoflavor);
-
-/* registering gss mechanisms to the mech switching code: */
-EXPORT_SYMBOL(gss_mech_register);
-EXPORT_SYMBOL(gss_mech_unregister);
-EXPORT_SYMBOL(gss_mech_get);
-EXPORT_SYMBOL(gss_mech_get_by_pseudoflavor);
-EXPORT_SYMBOL(gss_mech_get_by_name);
-EXPORT_SYMBOL(gss_mech_put);
-EXPORT_SYMBOL(gss_pseudoflavor_to_service);
-EXPORT_SYMBOL(gss_service_to_auth_domain_name);
-
-/* generic functionality in gss code: */
-EXPORT_SYMBOL(g_make_token_header);
-EXPORT_SYMBOL(g_verify_token_header);
-EXPORT_SYMBOL(g_token_size);
-EXPORT_SYMBOL(make_checksum);
-EXPORT_SYMBOL(krb5_encrypt);
-EXPORT_SYMBOL(krb5_decrypt);
-
-/* debug */
-EXPORT_SYMBOL(print_hexl);
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_des.c b/net/sunrpc/svcauth_des.c
deleted file mode 100644
index e4ac9b1f2fdc..000000000000
--- a/net/sunrpc/svcauth_des.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * linux/net/sunrpc/svcauth_des.c
- *
- * Server-side AUTH_DES handling.
- *
- * Copyright (C) 1996, 1997 Olaf Kirch <okir@monad.swb.de>
- */
-
-#include <linux/types.h>
-#include <linux/sched.h>
-#include <linux/sunrpc/types.h>
-#include <linux/sunrpc/xdr.h>
-#include <linux/sunrpc/svcauth.h>
-#include <linux/sunrpc/svcsock.h>
-
-#define RPCDBG_FACILITY RPCDBG_AUTH
-
-/*
- * DES cedential cache.
- * The cache is indexed by fullname/key to allow for multiple sessions
- * by the same user from different hosts.
- * It would be tempting to use the client's IP address rather than the
- * conversation key as an index, but that could become problematic for
- * multi-homed hosts that distribute traffic across their interfaces.
- */
-struct des_cred {
- struct des_cred * dc_next;
- char * dc_fullname;
- u32 dc_nickname;
- des_cblock dc_key; /* conversation key */
- des_cblock dc_xkey; /* encrypted conv. key */
- des_key_schedule dc_keysched;
-};
-
-#define ADN_FULLNAME 0
-#define ADN_NICKNAME 1
-
-/*
- * The default slack allowed when checking for replayed credentials
- * (in milliseconds).
- */
-#define DES_REPLAY_SLACK 2000
-
-/*
- * Make sure we don't place more than one call to the key server at
- * a time.
- */
-static int in_keycall;
-
-#define FAIL(err) \
- { if (data) put_cred(data); \
- *authp = rpc_autherr_##err; \
- return; \
- }
-
-void
-svcauth_des(struct svc_rqst *rqstp, u32 *statp, u32 *authp)
-{
- struct svc_buf *argp = &rqstp->rq_argbuf;
- struct svc_buf *resp = &rqstp->rq_resbuf;
- struct svc_cred *cred = &rqstp->rq_cred;
- struct des_cred *data = NULL;
- u32 cryptkey[2];
- u32 cryptbuf[4];
- u32 *p = argp->buf;
- int len = argp->len, slen, i;
-
- *authp = rpc_auth_ok;
-
- if ((argp->len -= 3) < 0) {
- *statp = rpc_garbage_args;
- return;
- }
-
- p++; /* skip length field */
- namekind = ntohl(*p++); /* fullname/nickname */
-
- /* Get the credentials */
- if (namekind == ADN_NICKNAME) {
- /* If we can't find the cached session key, initiate a
- * new session. */
- if (!(data = get_cred_bynick(*p++)))
- FAIL(rejectedcred);
- } else if (namekind == ADN_FULLNAME) {
- p = xdr_decode_string(p, &fullname, &len, RPC_MAXNETNAMELEN);
- if (p == NULL)
- FAIL(badcred);
- cryptkey[0] = *p++; /* get the encrypted key */
- cryptkey[1] = *p++;
- cryptbuf[2] = *p++; /* get the encrypted window */
- } else {
- FAIL(badcred);
- }
-
- /* If we're just updating the key, silently discard the request. */
- if (data && data->dc_locked) {
- *authp = rpc_autherr_dropit;
- _put_cred(data); /* release but don't unlock */
- return;
- }
-
- /* Get the verifier flavor and length */
- if (ntohl(*p++) != RPC_AUTH_DES && ntohl(*p++) != 12)
- FAIL(badverf);
-
- cryptbuf[0] = *p++; /* encrypted time stamp */
- cryptbuf[1] = *p++;
- cryptbuf[3] = *p++; /* 0 or window - 1 */
-
- if (namekind == ADN_NICKNAME) {
- status = des_ecb_encrypt((des_block *) cryptbuf,
- (des_block *) cryptbuf,
- data->dc_keysched, DES_DECRYPT);
- } else {
- /* We first have to decrypt the new session key and
- * fill in the UNIX creds. */
- if (!(data = get_cred_byname(rqstp, authp, fullname, cryptkey)))
- return;
- status = des_cbc_encrypt((des_cblock *) cryptbuf,
- (des_cblock *) cryptbuf, 16,
- data->dc_keysched,
- (des_cblock *) &ivec,
- DES_DECRYPT);
- }
- if (status) {
- printk("svcauth_des: DES decryption failed (status %d)\n",
- status);
- FAIL(badverf);
- }
-
- /* Now check the whole lot */
- if (namekind == ADN_FULLNAME) {
- unsigned long winverf;
-
- data->dc_window = ntohl(cryptbuf[2]);
- winverf = ntohl(cryptbuf[2]);
- if (window != winverf - 1) {
- printk("svcauth_des: bad window verifier!\n");
- FAIL(badverf);
- }
- }
-
- /* XDR the decrypted timestamp */
- cryptbuf[0] = ntohl(cryptbuf[0]);
- cryptbuf[1] = ntohl(cryptbuf[1]);
- if (cryptbuf[1] > 1000000) {
- dprintk("svcauth_des: bad usec value %u\n", cryptbuf[1]);
- if (namekind == ADN_NICKNAME)
- FAIL(rejectedverf);
- FAIL(badverf);
- }
-
- /*
- * Check for replayed credentials. We must allow for reordering
- * of requests by the network, and the OS scheduler, hence we
- * cannot expect timestamps to be increasing monotonically.
- * This opens a small security hole, therefore the replay_slack
- * value shouldn't be too large.
- */
- if ((delta = cryptbuf[0] - data->dc_timestamp[0]) <= 0) {
- switch (delta) {
- case -1:
- delta = -1000000;
- case 0:
- delta += cryptbuf[1] - data->dc_timestamp[1];
- break;
- default:
- delta = -1000000;
- }
- if (delta < DES_REPLAY_SLACK)
- FAIL(rejectedverf);
-#ifdef STRICT_REPLAY_CHECKS
- /* TODO: compare time stamp to last five timestamps cached
- * and reject (drop?) request if a match is found. */
-#endif
- }
-
- now = xtime;
- now.tv_secs -= data->dc_window;
- if (now.tv_secs < cryptbuf[0] ||
- (now.tv_secs == cryptbuf[0] && now.tv_usec < cryptbuf[1]))
- FAIL(rejectedverf);
-
- /* Okay, we're done. Update the lot */
- if (namekind == ADN_FULLNAME)
- data->dc_valid = 1;
- data->dc_timestamp[0] = cryptbuf[0];
- data->dc_timestamp[1] = cryptbuf[1];
-
- put_cred(data);
- return;
-garbage:
- *statp = rpc_garbage_args;
- return;
-}
-
-/*
- * Call the keyserver to obtain the decrypted conversation key and
- * UNIX creds. We use a Linux-specific keycall extension that does
- * both things in one go.
- */
-static struct des_cred *
-get_cred_byname(struct svc_rqst *rqstp, u32 *authp, char *fullname, u32 *cryptkey)
-{
- static int in_keycall;
- struct des_cred *cred;
-
- if (in_keycall) {
- *authp = rpc_autherr_dropit;
- return NULL;
- }
- in_keycall = 1;
- in_keycall = 0;
- return cred;
-}
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
@@ -33,15 +33,6 @@ xdr_encode_netobj(u32 *p, const struct xdr_netobj *obj)
}
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)
{
unsigned int len;
@@ -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);
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 8902c4aa900f..eb30bc7bf946 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -121,7 +121,7 @@
int sysctl_unix_max_dgram_qlen = 10;
-kmem_cache_t *unix_sk_cachep;
+static kmem_cache_t *unix_sk_cachep;
struct hlist_head unix_socket_table[UNIX_HASH_SIZE + 1];
rwlock_t unix_table_lock = RW_LOCK_UNLOCKED;
diff --git a/net/unix/sysctl_net_unix.c b/net/unix/sysctl_net_unix.c
index af1d297017a5..c974dac4580a 100644
--- a/net/unix/sysctl_net_unix.c
+++ b/net/unix/sysctl_net_unix.c
@@ -14,7 +14,7 @@
extern int sysctl_unix_max_dgram_qlen;
-ctl_table unix_table[] = {
+static ctl_table unix_table[] = {
{
.ctl_name = NET_UNIX_MAX_DGRAM_QLEN,
.procname = "max_dgram_qlen",
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;
@@ -156,32 +159,6 @@ void x25_transmit_restart_confirmation(struct x25_neigh *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,
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);