Commit a4bbc3c7 authored by Gilles Chanteperdrix's avatar Gilles Chanteperdrix Committed by Philippe Gerum
Browse files

rtnet: Kconfig fixes

rtcap and rtnetproxy must be enabled as modules
And some kernel configuration options are required for rtnet to even compile
parent a95d1abe
menu "RTnet"
config XENO_DRIVERS_NET
select NET
tristate "RTnet, TCP/IP socket interface"
source "drivers/xenomai/net/stack/Kconfig"
......
......@@ -2,8 +2,9 @@ menu "Add-Ons"
depends on XENO_DRIVERS_NET
config XENO_DRIVERS_NET_ADDON_RTCAP
depends on XENO_DRIVERS_NET
bool "Real-Time Capturing Support"
depends on XENO_DRIVERS_NET && m
select ETHERNET
tristate "Real-Time Capturing Support"
default n
---help---
This feature allows to capture real-time packets traversing the RTnet
......@@ -17,8 +18,9 @@ config XENO_DRIVERS_NET_ADDON_RTCAP
For further information see Documentation/README.rtcap.
config XENO_DRIVERS_NET_ADDON_PROXY
bool "IP protocol proxy for Linux"
depends on XENO_DRIVERS_NET_RTIPV4
depends on XENO_DRIVERS_NET_RTIPV4 && m
select ETHERNET
tristate "IP protocol proxy for Linux"
default n
---help---
Enables a forward-to-Linux module for all IP protocols that are not
......@@ -29,8 +31,8 @@ config XENO_DRIVERS_NET_ADDON_PROXY
See Documentation/README.rtnetproxy for further information.
config XENO_DRIVERS_NET_ADDON_PROXY_ARP
bool "Enable ARP handling via protocol proxy"
depends on XENO_DRIVERS_NET_ADDON_PROXY
bool "Enable ARP handling via protocol proxy"
default n
---help---
Enables ARP support for the IP protocol proxy. Incoming ARP replies
......
......@@ -27,7 +27,7 @@
extern int rt_ip_rcv(struct rtskb *skb, struct rtpacket_type *pt);
#ifdef CONFIG_XENO_DRIVERS_NET_ADDON_PROXY
#if IS_ENABLED(CONFIG_XENO_DRIVERS_NET_ADDON_PROXY)
typedef void (*rt_ip_fallback_handler_t)(struct rtskb *skb);
/*
......
......@@ -215,7 +215,7 @@ static inline void rtdev_dereference(struct rtnet_device *rtdev)
int rtdev_xmit(struct rtskb *skb);
#ifdef CONFIG_XENO_DRIVERS_NET_ADDON_PROXY
#if IS_ENABLED(CONFIG_XENO_DRIVERS_NET_ADDON_PROXY)
int rtdev_xmit_proxy(struct rtskb *skb);
#endif
......
......@@ -156,7 +156,7 @@ struct rtnet_device;
struct rtskb {
struct rtskb *next; /* used for queuing rtskbs */
struct rtskb *chain_end; /* marks the end of a rtskb chain starting
with this very rtskb */
with this very rtskb */
struct rtskb_pool *pool; /* owning pool */
......@@ -175,26 +175,26 @@ struct rtskb {
/* transport layer */
union
{
struct tcphdr *th;
struct udphdr *uh;
struct icmphdr *icmph;
struct iphdr *ipihdr;
unsigned char *raw;
struct tcphdr *th;
struct udphdr *uh;
struct icmphdr *icmph;
struct iphdr *ipihdr;
unsigned char *raw;
} h;
/* network layer */
union
{
struct iphdr *iph;
struct arphdr *arph;
unsigned char *raw;
struct iphdr *iph;
struct arphdr *arph;
unsigned char *raw;
} nh;
/* link layer */
union
{
struct ethhdr *ethernet;
unsigned char *raw;
struct ethhdr *ethernet;
unsigned char *raw;
} mac;
unsigned short protocol;
......@@ -216,7 +216,7 @@ struct rtskb {
unsigned char *buf_end;
#endif
#ifdef CONFIG_XENO_DRIVERS_NET_ADDON_RTCAP
#if IS_ENABLED(CONFIG_XENO_DRIVERS_NET_ADDON_RTCAP)
int cap_flags; /* see RTSKB_CAP_xxx */
struct rtskb *cap_comp_skb; /* compensation rtskb */
struct rtskb *cap_next; /* used for capture queue */
......@@ -340,14 +340,14 @@ static inline int rtskb_prio_queue_empty(struct rtskb_prio_queue *prioqueue)
* @skb: buffer to queue
*/
static inline void __rtskb_queue_head(struct rtskb_queue *queue,
struct rtskb *skb)
struct rtskb *skb)
{
struct rtskb *chain_end = skb->chain_end;
chain_end->next = queue->first;
if (queue->first == NULL)
queue->last = chain_end;
queue->last = chain_end;
queue->first = skb;
}
......@@ -372,7 +372,7 @@ static inline void rtskb_queue_head(struct rtskb_queue *queue, struct rtskb *skb
* @skb: buffer to queue
*/
static inline void __rtskb_prio_queue_head(struct rtskb_prio_queue *prioqueue,
struct rtskb *skb)
struct rtskb *skb)
{
unsigned int prio = skb->priority & RTSKB_PRIO_MASK;
......@@ -389,7 +389,7 @@ static inline void __rtskb_prio_queue_head(struct rtskb_prio_queue *prioqueue,
* @skb: buffer to queue
*/
static inline void rtskb_prio_queue_head(struct rtskb_prio_queue *prioqueue,
struct rtskb *skb)
struct rtskb *skb)
{
rtdm_lockctx_t context;
......@@ -404,16 +404,16 @@ static inline void rtskb_prio_queue_head(struct rtskb_prio_queue *prioqueue,
* @skb: buffer to queue
*/
static inline void __rtskb_queue_tail(struct rtskb_queue *queue,
struct rtskb *skb)
struct rtskb *skb)
{
struct rtskb *chain_end = skb->chain_end;
chain_end->next = NULL;
if (queue->first == NULL)
queue->first = skb;
queue->first = skb;
else
queue->last->next = skb;
queue->last->next = skb;
queue->last = chain_end;
}
......@@ -423,7 +423,7 @@ static inline void __rtskb_queue_tail(struct rtskb_queue *queue,
* @skb: buffer to queue
*/
static inline void rtskb_queue_tail(struct rtskb_queue *queue,
struct rtskb *skb)
struct rtskb *skb)
{
rtdm_lockctx_t context;
......@@ -439,7 +439,7 @@ static inline void rtskb_queue_tail(struct rtskb_queue *queue,
* @skb: buffer to queue
*/
static inline void __rtskb_prio_queue_tail(struct rtskb_prio_queue *prioqueue,
struct rtskb *skb)
struct rtskb *skb)
{
unsigned int prio = skb->priority & RTSKB_PRIO_MASK;
......@@ -456,7 +456,7 @@ static inline void __rtskb_prio_queue_tail(struct rtskb_prio_queue *prioqueue,
* @skb: buffer to queue
*/
static inline void rtskb_prio_queue_tail(struct rtskb_prio_queue *prioqueue,
struct rtskb *skb)
struct rtskb *skb)
{
rtdm_lockctx_t context;
......@@ -474,8 +474,8 @@ static inline struct rtskb *__rtskb_dequeue(struct rtskb_queue *queue)
struct rtskb *result;
if ((result = queue->first) != NULL) {
queue->first = result->next;
result->next = NULL;
queue->first = result->next;
result->next = NULL;
}
return result;
......@@ -510,11 +510,11 @@ static inline struct rtskb *
struct rtskb_queue *sub_queue;
if (prioqueue->usage) {
prio = ffz(~prioqueue->usage);
sub_queue = &prioqueue->queue[prio];
result = __rtskb_dequeue(sub_queue);
if (rtskb_queue_empty(sub_queue))
__change_bit(prio, &prioqueue->usage);
prio = ffz(~prioqueue->usage);
sub_queue = &prioqueue->queue[prio];
result = __rtskb_dequeue(sub_queue);
if (rtskb_queue_empty(sub_queue))
__change_bit(prio, &prioqueue->usage);
}
return result;
......@@ -549,9 +549,9 @@ static inline struct rtskb *__rtskb_dequeue_chain(struct rtskb_queue *queue)
struct rtskb *chain_end;
if ((result = queue->first) != NULL) {
chain_end = result->chain_end;
queue->first = chain_end->next;
chain_end->next = NULL;
chain_end = result->chain_end;
queue->first = chain_end->next;
chain_end->next = NULL;
}
return result;
......@@ -589,11 +589,11 @@ static inline
rtdm_lock_get_irqsave(&prioqueue->lock, context);
if (prioqueue->usage) {
prio = ffz(~prioqueue->usage);
sub_queue = &prioqueue->queue[prio];
result = __rtskb_dequeue_chain(sub_queue);
if (rtskb_queue_empty(sub_queue))
__change_bit(prio, &prioqueue->usage);
prio = ffz(~prioqueue->usage);
sub_queue = &prioqueue->queue[prio];
result = __rtskb_dequeue_chain(sub_queue);
if (rtskb_queue_empty(sub_queue))
__change_bit(prio, &prioqueue->usage);
}
rtdm_lock_put_irqrestore(&prioqueue->lock, context);
......@@ -608,7 +608,7 @@ static inline void rtskb_queue_purge(struct rtskb_queue *queue)
{
struct rtskb *skb;
while ( (skb=rtskb_dequeue(queue))!=NULL )
kfree_rtskb(skb);
kfree_rtskb(skb);
}
static inline int rtskb_headlen(const struct rtskb *skb)
......@@ -641,7 +641,7 @@ static inline unsigned char *__rtskb_put(struct rtskb *skb, unsigned int len)
__rtskb->len += __len; \
\
RTNET_ASSERT(__rtskb->tail <= __rtskb->buf_end, \
rtskb_over_panic(__rtskb, __len, current_text_addr());); \
rtskb_over_panic(__rtskb, __len, current_text_addr());); \
\
tmp; \
})
......@@ -662,7 +662,7 @@ static inline unsigned char *__rtskb_push(struct rtskb *skb, unsigned int len)
__rtskb->len += __len; \
\
RTNET_ASSERT(__rtskb->data >= __rtskb->buf_start, \
rtskb_under_panic(__rtskb, __len, current_text_addr());); \
rtskb_under_panic(__rtskb, __len, current_text_addr());); \
\
__rtskb->data; \
})
......@@ -679,7 +679,7 @@ static inline unsigned char *__rtskb_pull(struct rtskb *skb, unsigned int len)
static inline unsigned char *rtskb_pull(struct rtskb *skb, unsigned int len)
{
if (len > skb->len)
return NULL;
return NULL;
skb->len -= len;
......@@ -689,15 +689,15 @@ static inline unsigned char *rtskb_pull(struct rtskb *skb, unsigned int len)
static inline void rtskb_trim(struct rtskb *skb, unsigned int len)
{
if (skb->len>len) {
skb->len = len;
skb->tail = skb->data+len;
skb->len = len;
skb->tail = skb->data+len;
}
}
static inline struct rtskb *rtskb_padto(struct rtskb *rtskb, unsigned int len)
{
RTNET_ASSERT(len <= (unsigned int)(rtskb->buf_end + 1 - rtskb->data),
return NULL;);
return NULL;);
memset(rtskb->data + rtskb->len, 0, len - rtskb->len);
......@@ -705,7 +705,7 @@ static inline struct rtskb *rtskb_padto(struct rtskb *rtskb, unsigned int len)
}
static inline dma_addr_t rtskb_data_dma_addr(struct rtskb *rtskb,
unsigned int offset)
unsigned int offset)
{
return rtskb->buf_dma_addr + rtskb->data - rtskb->buf_start + offset;
}
......@@ -713,13 +713,13 @@ static inline dma_addr_t rtskb_data_dma_addr(struct rtskb *rtskb,
extern struct rtskb_pool global_pool;
extern unsigned int rtskb_pool_init(struct rtskb_pool *pool,
unsigned int initial_size,
const struct rtskb_pool_lock_ops *lock_ops,
void *lock_cookie);
unsigned int initial_size,
const struct rtskb_pool_lock_ops *lock_ops,
void *lock_cookie);
extern unsigned int __rtskb_module_pool_init(struct rtskb_pool *pool,
unsigned int initial_size,
struct module *module);
unsigned int initial_size,
struct module *module);
#define rtskb_module_pool_init(pool, size) \
__rtskb_module_pool_init(pool, size, THIS_MODULE)
......@@ -727,23 +727,23 @@ extern unsigned int __rtskb_module_pool_init(struct rtskb_pool *pool,
extern int rtskb_pool_release(struct rtskb_pool *pool);
extern unsigned int rtskb_pool_extend(struct rtskb_pool *pool,
unsigned int add_rtskbs);
unsigned int add_rtskbs);
extern unsigned int rtskb_pool_shrink(struct rtskb_pool *pool,
unsigned int rem_rtskbs);
unsigned int rem_rtskbs);
extern int rtskb_acquire(struct rtskb *rtskb, struct rtskb_pool *comp_pool);
extern struct rtskb* rtskb_clone(struct rtskb *rtskb,
struct rtskb_pool *pool);
struct rtskb_pool *pool);
extern int rtskb_pools_init(void);
extern void rtskb_pools_release(void);
extern unsigned int rtskb_copy_and_csum_bits(const struct rtskb *skb,
int offset, u8 *to, int len,
unsigned int csum);
int offset, u8 *to, int len,
unsigned int csum);
extern void rtskb_copy_and_csum_dev(const struct rtskb *skb, u8 *to);
#ifdef CONFIG_XENO_DRIVERS_NET_ADDON_RTCAP
#if IS_ENABLED(CONFIG_XENO_DRIVERS_NET_ADDON_RTCAP)
extern rtdm_lock_t rtcap_lock;
extern void (*rtcap_handler)(struct rtskb *skb);
......@@ -761,7 +761,7 @@ static inline void rtcap_report_incoming(struct rtskb *skb)
rtdm_lock_get_irqsave(&rtcap_lock, context);
if (rtcap_handler != NULL)
rtcap_handler(skb);
rtcap_handler(skb);
rtdm_lock_put_irqrestore(&rtcap_lock, context);
}
......
......@@ -33,7 +33,7 @@
#include <ipv4/ip_fragment.h>
#ifdef CONFIG_XENO_DRIVERS_NET_ADDON_PROXY
#if IS_ENABLED(CONFIG_XENO_DRIVERS_NET_ADDON_PROXY)
#include <ipv4/ip_input.h>
#endif /* CONFIG_XENO_DRIVERS_NET_ADDON_PROXY */
......@@ -185,7 +185,7 @@ static struct rtskb *add_to_collector(struct rtskb *skb, unsigned int offset, in
rtdm_lock_put_irqrestore(&p_coll->frags.lock, context);
}
#ifdef CONFIG_XENO_DRIVERS_NET_ADDON_PROXY
#if IS_ENABLED(CONFIG_XENO_DRIVERS_NET_ADDON_PROXY)
if (rt_ip_fallback_handler) {
__rtskb_push(skb, iph->ihl*4);
rt_ip_fallback_handler(skb);
......@@ -285,7 +285,7 @@ struct rtskb *rt_ip_defrag(struct rtskb *skb, struct rtinet_protocol *ipprot)
{
/* Get the destination socket */
if ((sock = ipprot->dest_socket(skb)) == NULL) {
#ifdef CONFIG_XENO_DRIVERS_NET_ADDON_PROXY
#if IS_ENABLED(CONFIG_XENO_DRIVERS_NET_ADDON_PROXY)
if (rt_ip_fallback_handler) {
__rtskb_push(skb, iph->ihl*4);
rt_ip_fallback_handler(skb);
......
......@@ -31,7 +31,7 @@
#include <ipv4/protocol.h>
#include <ipv4/route.h>
#ifdef CONFIG_XENO_DRIVERS_NET_ADDON_PROXY
#if IS_ENABLED(CONFIG_XENO_DRIVERS_NET_ADDON_PROXY)
#include <ipv4/ip_input.h>
rt_ip_fallback_handler_t rt_ip_fallback_handler = NULL;
......@@ -70,7 +70,7 @@ static inline void rt_ip_local_deliver(struct rtskb *skb)
} else {
/* Get the destination socket */
if ((sock = ipprot->dest_socket(skb)) == NULL) {
#ifdef CONFIG_XENO_DRIVERS_NET_ADDON_PROXY
#if IS_ENABLED(CONFIG_XENO_DRIVERS_NET_ADDON_PROXY)
if (rt_ip_fallback_handler) {
__rtskb_push(skb, iph->ihl*4);
rt_ip_fallback_handler(skb);
......@@ -95,7 +95,7 @@ static inline void rt_ip_local_deliver(struct rtskb *skb)
/* Deliver the packet to the next layer */
ipprot->rcv_handler(skb);
#ifdef CONFIG_XENO_DRIVERS_NET_ADDON_PROXY
#if IS_ENABLED(CONFIG_XENO_DRIVERS_NET_ADDON_PROXY)
} else if (rt_ip_fallback_handler) {
/* If a fallback handler for IP protocol has been installed,
* call it. */
......
......@@ -720,7 +720,7 @@ int rtdev_xmit(struct rtskb *rtskb)
#ifdef CONFIG_XENO_DRIVERS_NET_ADDON_PROXY
#if IS_ENABLED(CONFIG_XENO_DRIVERS_NET_ADDON_PROXY)
/***
* rtdev_xmit_proxy - send rtproxy packet
*/
......@@ -781,7 +781,7 @@ EXPORT_SYMBOL_GPL(rtdev_get_loopback);
EXPORT_SYMBOL_GPL(rtdev_xmit);
#ifdef CONFIG_XENO_DRIVERS_NET_ADDON_PROXY
#if IS_ENABLED(CONFIG_XENO_DRIVERS_NET_ADDON_PROXY)
EXPORT_SYMBOL_GPL(rtdev_xmit_proxy);
#endif
......
......@@ -48,7 +48,7 @@ unsigned int rtskb_pools_max=0;
unsigned int rtskb_amount=0;
unsigned int rtskb_amount_max=0;
#ifdef CONFIG_XENO_DRIVERS_NET_ADDON_RTCAP
#if IS_ENABLED(CONFIG_XENO_DRIVERS_NET_ADDON_RTCAP)
/* RTcap interface */
rtdm_lock_t rtcap_lock;
EXPORT_SYMBOL_GPL(rtcap_lock);
......@@ -228,7 +228,7 @@ struct rtskb *alloc_rtskb(unsigned int size, struct rtskb_pool *pool)
skb->pkt_type = PACKET_HOST;
skb->xmit_stamp = NULL;
#ifdef CONFIG_XENO_DRIVERS_NET_ADDON_RTCAP
#if IS_ENABLED(CONFIG_XENO_DRIVERS_NET_ADDON_RTCAP)
skb->cap_flags = 0;
#endif
......@@ -244,7 +244,7 @@ EXPORT_SYMBOL_GPL(alloc_rtskb);
*/
void kfree_rtskb(struct rtskb *skb)
{
#ifdef CONFIG_XENO_DRIVERS_NET_ADDON_RTCAP
#if IS_ENABLED(CONFIG_XENO_DRIVERS_NET_ADDON_RTCAP)
rtdm_lockctx_t context;
struct rtskb *comp_skb;
struct rtskb *next_skb;
......@@ -255,7 +255,7 @@ void kfree_rtskb(struct rtskb *skb)
RTNET_ASSERT(skb != NULL, return;);
RTNET_ASSERT(skb->pool != NULL, return;);
#ifdef CONFIG_XENO_DRIVERS_NET_ADDON_RTCAP
#if IS_ENABLED(CONFIG_XENO_DRIVERS_NET_ADDON_RTCAP)
next_skb = skb;
chain_end = skb->chain_end;
......@@ -535,7 +535,7 @@ int rtskb_pools_init(void)
if (rtskb_module_pool_init(&global_pool, global_rtskbs) < global_rtskbs)
goto err_out;
#ifdef CONFIG_XENO_DRIVERS_NET_ADDON_RTCAP
#if IS_ENABLED(CONFIG_XENO_DRIVERS_NET_ADDON_RTCAP)
rtdm_lock_init(&rtcap_lock);
#endif
......
nodist_sysconf_DATA = rtnet.conf
dist_sysconf_DATA = tdma.conf
CPPFLAGS = -I$(top_srcdir)/kernel/drivers/net/stack/include
sbin_SCRIPTS = rtnet
sbin_PROGRAMS = \
nomaccfg \
rtcfg \
rtifconfig \
rtiwconfig \
rtping \
rtroute \
tdmacfg
#! /bin/sh
staging=${DESTDIR}
prefix="@prefix@"
exec_prefix="@exec_prefix@"
libdir="@libdir@"
datadir="@datadir@"
pkgdatadir="${datadir}/@PACKAGE@"
includedir="@includedir@"
RTNET_VERSION="@PACKAGE_VERSION@"
RTNET_PREFIX="${staging}${prefix}"
RTNET_CC="@CC@"
RTNET_TARGET_ARCH="@RTNET_TARGET_ARCH@"
RTNET_CONFIG="${staging}${pkgdatadir}/config-rtnet-${RTNET_VERSION}"
RTNET_LINUX_DIR="@RTNET_LINUX_DIR@"
RTNET_LINUX_VERSION="@RTNET_LINUX_VERSION@"
RTNET_KERNEL_CFLAGS="-I. -I${staging}${includedir} @RTNET_KMOD_APP_CFLAGS@ @RTNET_FP_CFLAGS@"
RTNET_LIBRARY_DIR="${staging}${libdir}"
unset prefix exec_prefix libdir datadir pkgdatadir includedir
usage ()
{
cat <<EOF
Usage rtai-config OPTIONS
Options :
--help
--version
--cc
--arch
--subarch
--prefix
--config
--module-cflags
--module-cxxflags
--fusion-cflags
--fusion-ldflags
--uvm-cflags
--uvm-ldflags
--linux-dir
--linux-version
--module-dir
--library-dir
EOF
exit $1
}
if test $# -eq 0; then
usage 1 1>&2
fi
while test $# -gt 0; do
case "$1" in
--version)
echo ${RTNET_VERSION}-fusion
;;
--cc)
echo $RTNET_CC
;;
--arch)
echo $RTNET_TARGET_ARCH
;;
--subarch)
echo $RTNET_TARGET_SUBARCH
;;
--prefix)
echo $RTNET_PREFIX
;;
--config)
echo $RTNET_CONFIG
;;
--mod*-cflags|--kernel-cflags)
echo $RTNET_KERNEL_CFLAGS
;;
--fusion-cflags)
echo $RTNET_FUSION_CFLAGS
;;
--fusion-ldflags)
echo $RTNET_FUSION_LDFLAGS
;;
--uvm-cflags)
echo $RTNET_UVM_CFLAGS
;;
--uvm-ldflags)
echo $RTNET_UVM_LDFLAGS
;;
--mod*-dir)
echo $RTNET_MODULE_DIR
;;
--lib*-dir|--libdir|--user-libdir)
echo $RTNET_LIBRARY_DIR
;;
--linux-dir|--linux)
echo $RTNET_LINUX_DIR
;;
--linux-ver*)
echo $RTNET_LINUX_VERSION
;;
*)
usage 1 1>&2
;;
esac
shift
done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment