cne: Add reference count for Smart Wireless Interface Manager
Add the reference count for Smart Wireless Interface Manager to know whether there are any process who still has the socket in question in use or not. Enable INET DIAG. Redefine the TCP_FLAG as it gives compiling error when an enum is defined by a function return. Change-Id: I1aa9c810fec2e332048c9ef4199ec3f996bc3a75 Signed-off-by: Chinh Tran <chinht@codeaurora.org>
This commit is contained in:
@@ -71,7 +71,7 @@ CONFIG_IP_PNP_DHCP=y
|
|||||||
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
|
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
|
||||||
# CONFIG_INET_XFRM_MODE_BEET is not set
|
# CONFIG_INET_XFRM_MODE_BEET is not set
|
||||||
# CONFIG_INET_LRO is not set
|
# CONFIG_INET_LRO is not set
|
||||||
# CONFIG_INET_DIAG is not set
|
CONFIG_INET_DIAG=y
|
||||||
CONFIG_IPV6=y
|
CONFIG_IPV6=y
|
||||||
CONFIG_IPV6_PRIVACY=y
|
CONFIG_IPV6_PRIVACY=y
|
||||||
CONFIG_IPV6_ROUTER_PREF=y
|
CONFIG_IPV6_ROUTER_PREF=y
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ CONFIG_IP_PNP_DHCP=y
|
|||||||
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
|
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
|
||||||
# CONFIG_INET_XFRM_MODE_BEET is not set
|
# CONFIG_INET_XFRM_MODE_BEET is not set
|
||||||
# CONFIG_INET_LRO is not set
|
# CONFIG_INET_LRO is not set
|
||||||
# CONFIG_INET_DIAG is not set
|
CONFIG_INET_DIAG=y
|
||||||
CONFIG_IPV6=y
|
CONFIG_IPV6=y
|
||||||
CONFIG_IPV6_PRIVACY=y
|
CONFIG_IPV6_PRIVACY=y
|
||||||
CONFIG_IPV6_ROUTER_PREF=y
|
CONFIG_IPV6_ROUTER_PREF=y
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ CONFIG_IP_PNP_DHCP=y
|
|||||||
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
|
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
|
||||||
# CONFIG_INET_XFRM_MODE_BEET is not set
|
# CONFIG_INET_XFRM_MODE_BEET is not set
|
||||||
# CONFIG_INET_LRO is not set
|
# CONFIG_INET_LRO is not set
|
||||||
# CONFIG_INET_DIAG is not set
|
CONFIG_INET_DIAG=y
|
||||||
CONFIG_IPV6=y
|
CONFIG_IPV6=y
|
||||||
CONFIG_IPV6_PRIVACY=y
|
CONFIG_IPV6_PRIVACY=y
|
||||||
CONFIG_IPV6_ROUTER_PREF=y
|
CONFIG_IPV6_ROUTER_PREF=y
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ CONFIG_IP_PNP_DHCP=y
|
|||||||
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
|
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
|
||||||
# CONFIG_INET_XFRM_MODE_BEET is not set
|
# CONFIG_INET_XFRM_MODE_BEET is not set
|
||||||
# CONFIG_INET_LRO is not set
|
# CONFIG_INET_LRO is not set
|
||||||
# CONFIG_INET_DIAG is not set
|
CONFIG_INET_DIAG=y
|
||||||
CONFIG_IPV6=y
|
CONFIG_IPV6=y
|
||||||
CONFIG_IPV6_PRIVACY=y
|
CONFIG_IPV6_PRIVACY=y
|
||||||
CONFIG_IPV6_ROUTER_PREF=y
|
CONFIG_IPV6_ROUTER_PREF=y
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ CONFIG_IP_PNP_DHCP=y
|
|||||||
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
|
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
|
||||||
# CONFIG_INET_XFRM_MODE_BEET is not set
|
# CONFIG_INET_XFRM_MODE_BEET is not set
|
||||||
# CONFIG_INET_LRO is not set
|
# CONFIG_INET_LRO is not set
|
||||||
# CONFIG_INET_DIAG is not set
|
CONFIG_INET_DIAG=y
|
||||||
CONFIG_IPV6=y
|
CONFIG_IPV6=y
|
||||||
CONFIG_IPV6_PRIVACY=y
|
CONFIG_IPV6_PRIVACY=y
|
||||||
CONFIG_IPV6_ROUTER_PREF=y
|
CONFIG_IPV6_ROUTER_PREF=y
|
||||||
|
|||||||
@@ -69,16 +69,16 @@ union tcp_word_hdr {
|
|||||||
#define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3])
|
#define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3])
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
TCP_FLAG_CWR = __cpu_to_be32(0x00800000),
|
TCP_FLAG_CWR = __constant_htonl(0x00800000),
|
||||||
TCP_FLAG_ECE = __cpu_to_be32(0x00400000),
|
TCP_FLAG_ECE = __constant_htonl(0x00400000),
|
||||||
TCP_FLAG_URG = __cpu_to_be32(0x00200000),
|
TCP_FLAG_URG = __constant_htonl(0x00200000),
|
||||||
TCP_FLAG_ACK = __cpu_to_be32(0x00100000),
|
TCP_FLAG_ACK = __constant_htonl(0x00100000),
|
||||||
TCP_FLAG_PSH = __cpu_to_be32(0x00080000),
|
TCP_FLAG_PSH = __constant_htonl(0x00080000),
|
||||||
TCP_FLAG_RST = __cpu_to_be32(0x00040000),
|
TCP_FLAG_RST = __constant_htonl(0x00040000),
|
||||||
TCP_FLAG_SYN = __cpu_to_be32(0x00020000),
|
TCP_FLAG_SYN = __constant_htonl(0x00020000),
|
||||||
TCP_FLAG_FIN = __cpu_to_be32(0x00010000),
|
TCP_FLAG_FIN = __constant_htonl(0x00010000),
|
||||||
TCP_RESERVED_BITS = __cpu_to_be32(0x0F000000),
|
TCP_RESERVED_BITS = __constant_htonl(0x0F000000),
|
||||||
TCP_DATA_OFFSET = __cpu_to_be32(0xF0000000)
|
TCP_DATA_OFFSET = __constant_htonl(0xF0000000)
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -134,6 +134,7 @@ struct tcp_info {
|
|||||||
__u8 tcpi_backoff;
|
__u8 tcpi_backoff;
|
||||||
__u8 tcpi_options;
|
__u8 tcpi_options;
|
||||||
__u8 tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
|
__u8 tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
|
||||||
|
__u8 tcpi_count;
|
||||||
|
|
||||||
__u32 tcpi_rto;
|
__u32 tcpi_rto;
|
||||||
__u32 tcpi_ato;
|
__u32 tcpi_ato;
|
||||||
|
|||||||
@@ -2504,6 +2504,15 @@ void tcp_get_info(struct sock *sk, struct tcp_info *info)
|
|||||||
info->tcpi_rcv_space = tp->rcvq_space.space;
|
info->tcpi_rcv_space = tp->rcvq_space.space;
|
||||||
|
|
||||||
info->tcpi_total_retrans = tp->total_retrans;
|
info->tcpi_total_retrans = tp->total_retrans;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Expose reference count for socket.
|
||||||
|
*/
|
||||||
|
if (NULL != sk->sk_socket) {
|
||||||
|
struct file *filep = sk->sk_socket->file;
|
||||||
|
if (NULL != filep)
|
||||||
|
info->tcpi_count = atomic_read(&filep->f_count);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(tcp_get_info);
|
EXPORT_SYMBOL_GPL(tcp_get_info);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user