base/ipc/netrpc/netrpc.c File Reference

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/config.h>
#include <linux/version.h>
#include <linux/timer.h>
#include <linux/unistd.h>
#include <asm/uaccess.h>
#include <net/ip.h>
#include <rtai_schedcore.h>
#include <rtai_netrpc.h>
#include <rtai_sem.h>
#include <rtai_mbx.h>
#include "rtnetP.h"
#include <linux/poll.h>
#include <linux/net.h>

Include dependency graph for netrpc.c:

Include dependency graph

Go to the source code of this file.

Data Structures

struct  portslot_t
struct  req_rel_msg

Defines

#define COMPILE_ANYHOW
#define HARD_RTNET   0
#define SOFT_RTNET   1
#define MSG_SOFT   0
#define MSG_HARD   0
#define hard_rt_socket(a, b, c)   portslot[i].socket[0]
#define hard_rt_bind(a, b, c)
#define hard_rt_close(a)
#define hard_rt_socket_callback   soft_rt_socket_callback
#define hard_rt_recvfrom   soft_rt_recvfrom
#define hard_rt_sendto   soft_rt_sendto
#define LOCALHOST   "127.0.0.1"
#define BASEPORT   5000
#define NETRPC_STACK_SIZE   6000
#define MAX_DFUN_EXT   16
#define PRTSRVNAME   0xFFFFFFFF
#define NETRPC_TIMER_FREQ   50
#define ADRSZ   sizeof(struct sockaddr)
#define MOD_SIZE(indx)   ((indx) < mbx->size ? (indx) : (indx) - mbx->size)
#define SYSCALL_BGN()   do { int retval; mm_segment_t svdfs = get_fs(); set_fs(KERNEL_DS)
#define SYSCALL_END()   set_fs(svdfs); return retval; } while (0)

Functions

 MODULE_LICENSE ("GPL")
 MODULE_PARM (MaxStubs,"i")
 MODULE_PARM (MaxSocks,"i")
 MODULE_PARM (StackSize,"i")
 MODULE_PARM (ThisNode,"s")
 MODULE_PARM (ThisSoftNode,"s")
 MODULE_PARM (ThisHardNode,"s")
portslot_tget_portslot (void)
int gvb_portslot (struct portslot_t *portslotp)
int hash_fun (unsigned long long owner)
int hash_ins (unsigned long long owner)
int hash_find (unsigned long long owner)
int hash_find_if_not_ins (unsigned long long owner)
int hash_rem (unsigned long long owner)
void timer_fun (unsigned long none)
void set_netrpc_encoding (void *encode_fun, void *decode_fun, void *ext)
void net_resume_task (int sock, SEM *sem)
int get_min_tasks_cpuid (void)
int set_rtext (RT_TASK *, int, int, void(*)(void), unsigned int, void *)
int clr_rtext (RT_TASK *)
void rt_schedule_soft (RT_TASK *)
int soft_rt_fun_call (RT_TASK *task, void *fun, void *arg)
long long soft_rt_genfun_call (RT_TASK *task, void *fun, void *args, int argsize)
void thread_fun (RT_TASK *task)
int soft_kthread_init (RT_TASK *task, long fun, long arg, int priority)
int soft_kthread_delete (RT_TASK *task)
void soft_stub_fun (struct portslot_t *portslotp)
void hard_stub_fun (struct portslot_t *portslotp)
void trashmsg (struct portslot_t *portslotp, int hard)
void port_server_fun (RT_TASK *port_server)
int rt_send_req_rel_port (unsigned long node, int op, unsigned long id, MBX *mbx, int hard)
RT_TASKrt_find_asgn_stub (unsigned long long owner, int asgn)
int rt_rel_stub (unsigned long long owner)
int rt_waiting_return (unsigned long node, int port)
void mbx_signal (MBX *mbx)
int mbxput (MBX *mbx, char **msg, int msg_size)
void mbx_send_if (MBX *mbx, void *msg, int msg_size)
unsigned long long rt_net_rpc (long fun_ext_timed, long type, void *args, int argsize, int space)
int rt_get_net_rpc_ret (MBX *mbx, unsigned long long *retval, void *msg1, int *msglen1, void *msg2, int *msglen2, RTIME timeout, int type)
unsigned long ddn2nl (const char *ddn)
unsigned long rt_set_this_node (const char *ddn, unsigned long node, int hard)
int set_rt_fun_entries (struct rt_native_fun_entry *entry)
void reset_rt_fun_entries (struct rt_native_fun_entry *entry)
int init_softrtnet (void)
void cleanup_softrtnet (void)
void do_mod_timer (void)
int soft_rt_socket (int domain, int type, int protocol)
int soft_rt_close (int sock)
int soft_rt_bind (int sock, struct sockaddr *addr, int addrlen)
int soft_rt_socket_callback (int sock, int(*func)(int sock, void *arg), void *arg)
int soft_rt_sendto (int sock, const void *msg, int msglen, unsigned int sflags, struct sockaddr *to, int tolen)
int soft_rt_recvfrom (int sock, void *msg, int msglen, unsigned int flags, struct sockaddr *from, int *fromlen)
int kpoll (struct pollfd *ufds, unsigned int nfds, int timeout)
int ksocket (int family, int type, int protocol)
int kbind (int fd, struct sockaddr *umyaddr, int addrlen)
int kconnect (int fd, struct sockaddr *serv_addr, int addrlen)
int klisten (int fd, int backlog)
int kaccept (int fd, struct sockaddr *upeer_sockaddr, int *upeer_addrlen)
int kgetsockname (int fd, struct sockaddr *usockaddr, int *usockaddr_len)
int kgetpeername (int fd, struct sockaddr *usockaddr, int *usockaddr_len)
int ksocketpair (int family, int type, int protocol, int *usockvec)
int ksendto (int fd, void *buff, size_t len, unsigned flags, struct sockaddr *addr, int addr_len)
int krecvfrom (int fd, void *ubuf, size_t len, unsigned flags, struct sockaddr *addr, int *addr_len)
int kshutdown (int fd, int how)
int ksetsockopt (int fd, int level, int optname, void *optval, int optlen)
int kgetsockopt (int fd, int level, int optname, char *optval, int *optlen)
int ksendmsg (int fd, struct msghdr *msg, unsigned flags)
int krecvmsg (int fd, struct msghdr *msg, unsigned flags)
int ksend (int fd, void *buff, size_t len, unsigned flags)
int krecv (int fd, void *ubuf, size_t size, unsigned flags)
 DECLARE_MUTEX_LOCKED (mtx)
void send_thread (void)
void recv_thread (void)
void softrtnet_hdl (void)
int __rtai_netrpc_init (void)
void __rtai_netrpc_exit (void)
 module_init (__rtai_netrpc_init)
 module_exit (__rtai_netrpc_exit)
 EXPORT_SYMBOL (set_netrpc_encoding)
 EXPORT_SYMBOL (rt_send_req_rel_port)
 EXPORT_SYMBOL (rt_find_asgn_stub)
 EXPORT_SYMBOL (rt_rel_stub)
 EXPORT_SYMBOL (rt_waiting_return)
 EXPORT_SYMBOL (rt_net_rpc)
 EXPORT_SYMBOL (rt_get_net_rpc_ret)
 EXPORT_SYMBOL (rt_set_this_node)
 EXPORT_SYMBOL (soft_rt_socket)
 EXPORT_SYMBOL (soft_rt_close)
 EXPORT_SYMBOL (soft_rt_bind)
 EXPORT_SYMBOL (soft_rt_sendto)
 EXPORT_SYMBOL (soft_rt_recvfrom)
 EXPORT_SYMBOL (ddn2nl)

Variables

unsigned long MaxStubs = MAX_STUBS
int MaxStubsMone
unsigned long MaxSocks = MAX_SOCKS
int StackSize = NETRPC_STACK_SIZE
char * ThisNode = LOCALHOST
char * ThisSoftNode = 0
char * ThisHardNode = 0
rt_fun_entry * rt_net_rpc_fun_ext [MAX_DFUN_EXT]
unsigned long this_node [2]
spinlock_t portslot_lock = SPIN_LOCK_UNLOCKED
volatile int portslotsp
portslot_tportslot
sockaddr_in SPRT_ADDR
spinlock_t req_rel_lock = SPIN_LOCK_UNLOCKED
timer_list timer
SEM timer_sem
int(* encode )(struct portslot_t *portslotp, void *msg, int size, int where)
int(* decode )(struct portslot_t *portslotp, void *msg, int size, int where)
int mod_timer_srq
rt_native_fun_entry rt_netrpc_entries []
RT_TASKport_server
sock_tsocks
int MaxSockSrq
struct {
   int   srq
   int   in
   int   out
   int *   sockindx
sysrq
spinlock_t sysrq_lock = SPIN_LOCK_UNLOCKED
int errno
void * sys_call_table []
unsigned long end_softrtnet
pollfd * pollv
task_struct * recv_handle
void ** rt_net_rpc_fun_hook = (void *)rt_net_rpc_fun_ext


Define Documentation

#define ADRSZ   sizeof(struct sockaddr)
 

Definition at line 349 of file netrpc.c.

Referenced by __rtai_netrpc_init(), hard_stub_fun(), init_softrtnet(), port_server_fun(), rt_net_rpc(), rt_send_req_rel_port(), send_thread(), and soft_stub_fun().

#define BASEPORT   5000
 

Definition at line 98 of file netrpc.c.

Referenced by __rtai_netrpc_init(), init_softrtnet(), and port_server_fun().

#define COMPILE_ANYHOW
 

Definition at line 37 of file netrpc.c.

#define hard_rt_bind a,
b,
 ) 
 

Definition at line 56 of file netrpc.c.

Referenced by __rtai_netrpc_init().

#define hard_rt_close  ) 
 

Definition at line 57 of file netrpc.c.

Referenced by __rtai_netrpc_exit().

#define hard_rt_recvfrom   soft_rt_recvfrom
 

Definition at line 59 of file netrpc.c.

Referenced by hard_stub_fun(), port_server_fun(), rt_net_rpc(), rt_send_req_rel_port(), and trashmsg().

#define hard_rt_sendto   soft_rt_sendto
 

Definition at line 60 of file netrpc.c.

Referenced by hard_stub_fun(), port_server_fun(), rt_net_rpc(), and rt_send_req_rel_port().

#define hard_rt_socket a,
b,
 )     portslot[i].socket[0]
 

Definition at line 55 of file netrpc.c.

Referenced by __rtai_netrpc_init().

#define hard_rt_socket_callback   soft_rt_socket_callback
 

Definition at line 58 of file netrpc.c.

Referenced by __rtai_netrpc_init().

#define HARD_RTNET   0
 

Definition at line 42 of file netrpc.c.

#define LOCALHOST   "127.0.0.1"
 

Definition at line 97 of file netrpc.c.

#define MAX_DFUN_EXT   16
 

Definition at line 120 of file netrpc.c.

#define MOD_SIZE indx   )     ((indx) < mbx->size ? (indx) : (indx) - mbx->size)
 

Definition at line 781 of file netrpc.c.

#define MSG_HARD   0
 

Definition at line 54 of file netrpc.c.

Referenced by rt_send_req_rel_port(), and rt_set_this_node().

#define MSG_SOFT   0
 

Definition at line 53 of file netrpc.c.

Referenced by rt_send_req_rel_port(), and rt_set_this_node().

#define NETRPC_STACK_SIZE   6000
 

Definition at line 99 of file netrpc.c.

#define NETRPC_TIMER_FREQ   50
 

Definition at line 258 of file netrpc.c.

Referenced by do_mod_timer(), rt_send_req_rel_port(), soft_kthread_init(), and timer_fun().

#define PRTSRVNAME   0xFFFFFFFF
 

Definition at line 125 of file netrpc.c.

Referenced by __rtai_netrpc_init(), and rt_send_req_rel_port().

#define SOFT_RTNET   1
 

Definition at line 45 of file netrpc.c.

 
#define SYSCALL_BGN  )     do { int retval; mm_segment_t svdfs = get_fs(); set_fs(KERNEL_DS)
 

Definition at line 1100 of file netrpc.c.

Referenced by kaccept(), kbind(), kconnect(), kgetpeername(), kgetsockname(), kgetsockopt(), klisten(), kpoll(), krecvfrom(), krecvmsg(), ksendmsg(), ksendto(), ksetsockopt(), kshutdown(), ksocket(), and ksocketpair().

 
#define SYSCALL_END  )     set_fs(svdfs); return retval; } while (0)
 

Definition at line 1102 of file netrpc.c.

Referenced by kaccept(), kbind(), kconnect(), kgetpeername(), kgetsockname(), kgetsockopt(), klisten(), kpoll(), krecvfrom(), krecvmsg(), ksendmsg(), ksendto(), ksetsockopt(), kshutdown(), ksocket(), and ksocketpair().


Function Documentation

void __rtai_netrpc_exit void   ) 
 

Definition at line 1605 of file netrpc.c.

References cleanup_softrtnet(), hard_rt_close, MaxSocks, MaxStubs, mod_timer_srq, port_server, portslot, reset_rt_fun_entries(), rt_free_srq(), rt_netrpc_entries, rt_sem_delete(), RT_TASK, rt_task_delete(), soft_kthread_delete(), soft_rt_close(), task, portslot_t::task, timer, and timer_sem.

Here is the call graph for this function:

int __rtai_netrpc_init void   ) 
 

Definition at line 1541 of file netrpc.c.

References portslot_t::addr, ADRSZ, BASEPORT, BIN_SEM, ddn2nl(), do_mod_timer(), FIFO_Q, hard_rt_bind, hard_rt_socket, hard_rt_socket_callback, portslot_t::indx, init_softrtnet(), MaxSocks, MaxStubs, MaxStubsMone, mod_timer_srq, portslot_t::name, net_resume_task(), NET_RPC_EXT, OWNER, portslot_t::owner, portslot_t::p, port_server, port_server_fun(), portslot, portslotsp, printk(), PRTSRVNAME, rt_fun_lxrt, rt_net_rpc_fun_ext, rt_netrpc_entries, rt_request_srq(), RT_SCHED_LOWEST_PRIORITY, RT_TASK, rt_task_resume(), rt_typed_sem_init(), set_rt_fun_entries(), portslot_t::socket, soft_kthread_init(), soft_rt_bind(), soft_rt_socket(), soft_rt_socket_callback(), SPRT_ADDR, portslot_t::task, this_node, ThisHardNode, ThisNode, ThisSoftNode, timer, timer_fun(), and timer_sem.

Here is the call graph for this function:

void cleanup_softrtnet void   )  [static]
 

Definition at line 1499 of file netrpc.c.

References end_softrtnet, kshutdown(), MaxSocks, pollv, rt_free_srq(), socks, softrtnet_hdl(), and sysrq.

Referenced by __rtai_netrpc_exit().

Here is the call graph for this function:

int clr_rtext RT_TASK  ) 
 

Definition at line 1014 of file sched.c.

unsigned long ddn2nl const char *  ddn  ) 
 

Definition at line 964 of file netrpc.c.

Referenced by __rtai_netrpc_init(), and rt_set_this_node().

DECLARE_MUTEX_LOCKED mtx   )  [static]
 

void do_mod_timer void   ) 
 

Definition at line 1012 of file netrpc.c.

References NETRPC_TIMER_FREQ, and timer.

Referenced by __rtai_netrpc_init().

EXPORT_SYMBOL ddn2nl   ) 
 

EXPORT_SYMBOL soft_rt_recvfrom   ) 
 

EXPORT_SYMBOL soft_rt_sendto   ) 
 

EXPORT_SYMBOL soft_rt_bind   ) 
 

EXPORT_SYMBOL soft_rt_close   ) 
 

EXPORT_SYMBOL soft_rt_socket   ) 
 

EXPORT_SYMBOL rt_set_this_node   ) 
 

EXPORT_SYMBOL rt_get_net_rpc_ret   ) 
 

EXPORT_SYMBOL rt_net_rpc   ) 
 

EXPORT_SYMBOL rt_waiting_return   ) 
 

EXPORT_SYMBOL rt_rel_stub   ) 
 

EXPORT_SYMBOL rt_find_asgn_stub   ) 
 

EXPORT_SYMBOL rt_send_req_rel_port   ) 
 

EXPORT_SYMBOL set_netrpc_encoding   ) 
 

int get_min_tasks_cpuid void   ) 
 

Definition at line 224 of file sched.c.

Referenced by __task_init(), rt_kthread_init(), rt_set_runnable_on_cpuid(), rt_set_runnable_on_cpus(), and thread_fun().

struct portslot_t* get_portslot void   )  [inline, static]
 

Definition at line 132 of file netrpc.c.

References flags, MaxSocks, portslot_t::p, portslot, portslot_lock, portslotsp, rt_spin_lock_irqsave(), and rt_spin_unlock_irqrestore.

Referenced by rt_send_req_rel_port().

Here is the call graph for this function:

int gvb_portslot struct portslot_t portslotp  )  [inline, static]
 

Definition at line 147 of file netrpc.c.

References flags, MaxStubs, portslot_t::p, portslot, portslot_lock, portslotsp, rt_spin_lock_irqsave(), and rt_spin_unlock_irqrestore.

Referenced by rt_send_req_rel_port().

Here is the call graph for this function:

void hard_stub_fun struct portslot_t portslotp  )  [static]
 

Definition at line 421 of file netrpc.c.

References portslot_t::addr, ADRSZ, decode, encode, EXT, FUN, hard_rt_recvfrom, hard_rt_sendto, MAX_MSG_SIZE, nano2count(), RPC_RTR, RPC_SRV, rt_net_rpc_fun_ext, RT_SCHED_LINUX_PRIORITY, rt_sem_wait(), RT_TASK, rt_task_suspend(), portslot_t::sem, SEM, SEM_ERR, portslot_t::socket, portslot_t::task, task, and TIMED.

Referenced by port_server_fun().

Here is the call graph for this function:

int hash_find unsigned long long  owner  )  [inline, static]
 

Definition at line 194 of file netrpc.c.

References hash_fun, MaxStubsMone, portslot_t::owner, and portslot.

Referenced by rt_find_asgn_stub().

int hash_find_if_not_ins unsigned long long  owner  )  [inline, static]
 

Definition at line 207 of file netrpc.c.

References flags, hash_fun, MaxStubsMone, portslot_t::owner, portslot, req_rel_lock, rt_spin_lock_irqsave(), and rt_spin_unlock_irqrestore.

Referenced by port_server_fun(), and rt_find_asgn_stub().

Here is the call graph for this function:

int hash_fun unsigned long long  owner  )  [inline, static]
 

Definition at line 163 of file netrpc.c.

References MaxStubsMone.

int hash_ins unsigned long long  owner  )  [inline, static]
 

Definition at line 170 of file netrpc.c.

References flags, hash_fun, MaxStubsMone, portslot_t::owner, portslot, req_rel_lock, rt_spin_lock_irqsave(), and rt_spin_unlock_irqrestore.

Here is the call graph for this function:

int hash_rem unsigned long long  owner  )  [inline, static]
 

Definition at line 234 of file netrpc.c.

References flags, hash_fun, MaxStubsMone, portslot_t::owner, portslot, req_rel_lock, rt_spin_lock_irqsave(), and rt_spin_unlock_irqrestore.

Referenced by rt_rel_stub().

Here is the call graph for this function:

int init_softrtnet void   )  [static]
 

Definition at line 1446 of file netrpc.c.

References sock_t::addrlen, ADRSZ, BASEPORT, kbind(), ksocket(), MaxSocks, MaxSockSrq, pollv, printk(), recv_handle, recv_thread(), rt_free_srq(), rt_request_srq(), send_thread(), sock_t::sock, socks, softrtnet_hdl(), SPRT_ADDR, and sysrq.

Referenced by __rtai_netrpc_init().

Here is the call graph for this function:

int kaccept int  fd,
struct sockaddr *  upeer_sockaddr,
int *  upeer_addrlen
[inline, static]
 

Definition at line 1285 of file netrpc.c.

References sys_call_table, SYSCALL_BGN, and SYSCALL_END.

int kbind int  fd,
struct sockaddr *  umyaddr,
int  addrlen
[inline, static]
 

Definition at line 1258 of file netrpc.c.

References sys_call_table, SYSCALL_BGN, and SYSCALL_END.

Referenced by init_softrtnet().

int kconnect int  fd,
struct sockaddr *  serv_addr,
int  addrlen
[inline, static]
 

Definition at line 1267 of file netrpc.c.

References sys_call_table, SYSCALL_BGN, and SYSCALL_END.

int kgetpeername int  fd,
struct sockaddr *  usockaddr,
int *  usockaddr_len
[inline, static]
 

Definition at line 1303 of file netrpc.c.

References sys_call_table, SYSCALL_BGN, and SYSCALL_END.

int kgetsockname int  fd,
struct sockaddr *  usockaddr,
int *  usockaddr_len
[inline, static]
 

Definition at line 1294 of file netrpc.c.

References sys_call_table, SYSCALL_BGN, and SYSCALL_END.

int kgetsockopt int  fd,
int  level,
int  optname,
char *  optval,
int *  optlen
[inline, static]
 

Definition at line 1357 of file netrpc.c.

References sys_call_table, SYSCALL_BGN, and SYSCALL_END.

int klisten int  fd,
int  backlog
[inline, static]
 

Definition at line 1276 of file netrpc.c.

References sys_call_table, SYSCALL_BGN, and SYSCALL_END.

int kpoll struct pollfd *  ufds,
unsigned int  nfds,
int  timeout
[inline, static]
 

Definition at line 1240 of file netrpc.c.

References sys_call_table, SYSCALL_BGN, and SYSCALL_END.

Referenced by recv_thread().

int krecv int  fd,
void *  ubuf,
size_t  size,
unsigned  flags
[inline, static]
 

Definition at line 1390 of file netrpc.c.

References flags, and krecvfrom().

Here is the call graph for this function:

int krecvfrom int  fd,
void *  ubuf,
size_t  len,
unsigned  flags,
struct sockaddr *  addr,
int *  addr_len
[inline, static]
 

Definition at line 1330 of file netrpc.c.

References flags, sys_call_table, SYSCALL_BGN, and SYSCALL_END.

Referenced by krecv(), and recv_thread().

int krecvmsg int  fd,
struct msghdr *  msg,
unsigned  flags
[inline, static]
 

Definition at line 1375 of file netrpc.c.

References flags, sys_call_table, SYSCALL_BGN, and SYSCALL_END.

int ksend int  fd,
void *  buff,
size_t  len,
unsigned  flags
[inline, static]
 

Definition at line 1385 of file netrpc.c.

References flags, and ksendto().

Here is the call graph for this function:

int ksendmsg int  fd,
struct msghdr *  msg,
unsigned  flags
[inline, static]
 

Definition at line 1366 of file netrpc.c.

References flags, sys_call_table, SYSCALL_BGN, and SYSCALL_END.

int ksendto int  fd,
void *  buff,
size_t  len,
unsigned  flags,
struct sockaddr *  addr,
int  addr_len
[inline, static]
 

Definition at line 1321 of file netrpc.c.

References flags, sys_call_table, SYSCALL_BGN, and SYSCALL_END.

Referenced by ksend(), and send_thread().

int ksetsockopt int  fd,
int  level,
int  optname,
void *  optval,
int  optlen
[inline, static]
 

Definition at line 1348 of file netrpc.c.

References sys_call_table, SYSCALL_BGN, and SYSCALL_END.

int kshutdown int  fd,
int  how
[inline, static]
 

Definition at line 1339 of file netrpc.c.

References sys_call_table, SYSCALL_BGN, and SYSCALL_END.

Referenced by cleanup_softrtnet().

int ksocket int  family,
int  type,
int  protocol
[inline, static]
 

Definition at line 1249 of file netrpc.c.

References sys_call_table, SYSCALL_BGN, and SYSCALL_END.

Referenced by init_softrtnet().

int ksocketpair int  family,
int  type,
int  protocol,
int *  usockvec
[inline, static]
 

Definition at line 1312 of file netrpc.c.

References sys_call_table, SYSCALL_BGN, and SYSCALL_END.

void mbx_send_if MBX mbx,
void *  msg,
int  msg_size
[static]
 

Definition at line 807 of file netrpc.c.

References flags, MBX, mbx_signal(), mbxput(), RT_MBX_MAGIC, rt_sem_signal(), and RT_TASK.

Referenced by rt_net_rpc(), rtf_get_if(), and rtf_put_if().

Here is the call graph for this function:

void mbx_signal MBX mbx  )  [inline, static]
 

Definition at line 720 of file netrpc.c.

References cpuid, flags, MBX, RT_SCHED_DELAYED, RT_SCHED_MBXSUSP, RT_SCHED_READY, RT_SCHED_SUSPENDED, rt_schedule(), RT_TASK, rt_task_delete(), and task.

Referenced by _rt_mbx_ovrwr_send(), _rt_mbx_receive(), _rt_mbx_receive_if(), _rt_mbx_receive_until(), _rt_mbx_receive_wp(), _rt_mbx_send(), _rt_mbx_send_if(), _rt_mbx_send_until(), _rt_mbx_send_wp(), mbx_delete(), mbx_ovrwr_send(), mbx_receive(), mbx_receive_if(), mbx_receive_timed(), mbx_receive_wjo(), mbx_receive_wp(), mbx_send(), mbx_send_if(), mbx_send_timed(), mbx_send_wp(), rtf_reset(), and rtf_resize().

Here is the call graph for this function:

int mbxput MBX mbx,
char **  msg,
int  msg_size
[inline, static]
 

Definition at line 783 of file netrpc.c.

References flags, MBX, MOD_SIZE, rt_spin_lock_irqsave(), and rt_spin_unlock_irqrestore.

Referenced by _rt_mbx_send(), _rt_mbx_send_if(), _rt_mbx_send_until(), _rt_mbx_send_wp(), and mbx_send_if().

Here is the call graph for this function:

module_exit __rtai_netrpc_exit   ) 
 

module_init __rtai_netrpc_init   ) 
 

MODULE_LICENSE "GPL"   ) 
 

MODULE_PARM ThisHardNode  ,
"s" 
 

MODULE_PARM ThisSoftNode  ,
"s" 
 

MODULE_PARM ThisNode  ,
"s" 
 

MODULE_PARM StackSize  ,
"i" 
 

MODULE_PARM MaxSocks  ,
"i" 
 

MODULE_PARM MaxStubs  ,
"i" 
 

void net_resume_task int  sock,
SEM sem
[static]
 

Definition at line 283 of file netrpc.c.

References rt_sem_signal(), and SEM.

Referenced by __rtai_netrpc_init().

Here is the call graph for this function:

void port_server_fun RT_TASK port_server  )  [static]
 

Definition at line 500 of file netrpc.c.

References portslot_t::addr, ADRSZ, BASEPORT, decode, encode, flags, portslot_t::hard, hard_rt_recvfrom, hard_rt_sendto, hard_stub_fun(), hash_find_if_not_ins(), MAX_MSG_SIZE, MaxStubs, portslot_t::name, portslot_t::owner, port_server, portslot, PRT_RTR, PRT_SRV, req_rel_lock, rt_sem_wait(), rt_spin_lock_irqsave(), rt_spin_unlock_irqrestore, RT_TASK, rt_task_delete(), rt_task_init(), rt_task_resume(), portslot_t::sem, SEM_ERR, soft_kthread_delete(), soft_kthread_init(), soft_rt_fun_call(), soft_rt_recvfrom(), soft_rt_sendto(), soft_stub_fun(), StackSize, portslot_t::task, task, and trashmsg().

Referenced by __rtai_netrpc_init().

Here is the call graph for this function:

void recv_thread void   )  [static]
 

Definition at line 1419 of file netrpc.c.

References sock_t::callback, end_softrtnet, kpoll(), krecvfrom(), MAX_MSG_SIZE, MaxSocks, pollv, recv_handle, sock_t::recvd, and socks.

Referenced by init_softrtnet().

Here is the call graph for this function:

RT_TASK* rt_find_asgn_stub unsigned long long  owner,
int  asgn
 

Definition at line 652 of file netrpc.c.

References hash_find(), hash_find_if_not_ins(), portslot, RT_TASK, and portslot_t::task.

Referenced by RT_evdrp(), RT_evdrpx(), RT_receive(), RT_receive_if(), RT_receive_timed(), RT_receive_until(), RT_receivex(), RT_receivex_if(), RT_receivex_timed(), RT_receivex_until(), RT_return(), and RT_returnx().

Here is the call graph for this function:

int rt_get_net_rpc_ret MBX mbx,
unsigned long long *  retval,
void *  msg1,
int *  msglen1,
void *  msg2,
int *  msglen2,
RTIME  timeout,
int  type
 

Definition at line 936 of file netrpc.c.

References _rt_mbx_receive(), MBX, NET_RPC_EXT, rt_net_rpc_fun_ext, and RTIME.

Here is the call graph for this function:

unsigned long long rt_net_rpc long  fun_ext_timed,
long  type,
void *  args,
int  argsize,
int  space
 

Definition at line 833 of file netrpc.c.

References ADRSZ, decode, encode, FUN, hard_rt_recvfrom, hard_rt_sendto, MAX_MSG_SIZE, mbx_send_if(), PORT, portslot, RPC_RCV, RPC_REQ, rt_sem_wait(), rt_sem_wait_if(), RT_TASK, soft_rt_recvfrom(), soft_rt_sendto(), SYNC_NET_RPC, and task.

Here is the call graph for this function:

int rt_rel_stub unsigned long long  owner  ) 
 

Definition at line 659 of file netrpc.c.

References hash_rem().

Here is the call graph for this function:

void rt_schedule_soft RT_TASK  ) 
 

Definition at line 1774 of file sched.c.

int rt_send_req_rel_port unsigned long  node,
int  op,
unsigned long  id,
MBX mbx,
int  hard
 

Definition at line 579 of file netrpc.c.

References ADRSZ, decode, encode, get_portslot(), gvb_portslot(), portslot_t::hard, req_rel_msg::hard, hard_rt_recvfrom, hard_rt_sendto, MaxSocks, MBX, mod_timer_srq, MSG_HARD, MSG_SOFT, portslot_t::name, req_rel_msg::name, NETRPC_TIMER_FREQ, req_rel_msg::op, OWNER, req_rel_msg::owner, req_rel_msg::port, portslot, req_rel_msg::priority, PRT_RCV, PRT_REQ, PRTSRVNAME, rt_pend_linux_srq(), rt_sem_wait(), RT_TASK, soft_rt_recvfrom(), soft_rt_sendto(), SPRT_ADDR, portslot_t::task, task, this_node, timer_sem, and trashmsg().

Here is the call graph for this function:

unsigned long rt_set_this_node const char *  ddn,
unsigned long  node,
int  hard
 

Definition at line 986 of file netrpc.c.

References ddn2nl(), MSG_HARD, MSG_SOFT, and this_node.

Here is the call graph for this function:

int rt_waiting_return unsigned long  node,
int  port
 

Definition at line 664 of file netrpc.c.

References portslot.

void send_thread void   )  [static]
 

Definition at line 1398 of file netrpc.c.

References ADRSZ, end_softrtnet, ksendto(), MaxSockSrq, socks, and sysrq.

Referenced by init_softrtnet().

Here is the call graph for this function:

void set_netrpc_encoding void *  encode_fun,
void *  decode_fun,
void *  ext
 

Definition at line 274 of file netrpc.c.

References decode, encode, and rt_net_rpc_fun_ext.

int set_rtext RT_TASK ,
int  ,
int  ,
void(*  )(void),
unsigned  int,
void * 
 

int soft_kthread_delete RT_TASK task  )  [static]
 

Definition at line 335 of file netrpc.c.

References clr_rtext(), RT_TASK, and task.

Referenced by __rtai_netrpc_exit(), and port_server_fun().

Here is the call graph for this function:

int soft_kthread_init RT_TASK task,
long  fun,
long  arg,
int  priority
[static]
 

Definition at line 319 of file netrpc.c.

References NETRPC_TIMER_FREQ, RT_SCHED_READY, RT_SCHED_SUSPENDED, RT_TASK, task, and thread_fun().

Referenced by __rtai_netrpc_init(), and port_server_fun().

Here is the call graph for this function:

int soft_rt_bind int  sock,
struct sockaddr *  addr,
int  addrlen
 

Definition at line 1040 of file netrpc.c.

Referenced by __rtai_netrpc_init().

int soft_rt_close int  sock  ) 
 

Definition at line 1032 of file netrpc.c.

References MaxSocks, sock_t::opnd, and socks.

Referenced by __rtai_netrpc_exit().

int soft_rt_fun_call RT_TASK task,
void *  fun,
void *  arg
[inline, static]
 

Definition at line 293 of file netrpc.c.

References rt_schedule_soft(), RT_TASK, and task.

Referenced by port_server_fun(), soft_stub_fun(), and thread_fun().

Here is the call graph for this function:

long long soft_rt_genfun_call RT_TASK task,
void *  fun,
void *  args,
int  argsize
[inline, static]
 

Definition at line 301 of file netrpc.c.

References rt_schedule_soft(), RT_TASK, and task.

Referenced by soft_stub_fun().

Here is the call graph for this function:

int soft_rt_recvfrom int  sock,
void *  msg,
int  msglen,
unsigned int  flags,
struct sockaddr *  from,
int *  fromlen
 

Definition at line 1078 of file netrpc.c.

References sock_t::addrlen, MaxSocks, sock_t::recvd, and socks.

Referenced by port_server_fun(), rt_net_rpc(), rt_send_req_rel_port(), soft_stub_fun(), and trashmsg().

int soft_rt_sendto int  sock,
const void *  msg,
int  msglen,
unsigned int  sflags,
struct sockaddr *  to,
int  tolen
 

Definition at line 1059 of file netrpc.c.

References flags, MAX_MSG_SIZE, MaxSocks, MaxSockSrq, rt_pend_linux_srq(), rt_spin_lock_irqsave(), rt_spin_unlock_irqrestore, socks, sysrq, and sysrq_lock.

Referenced by port_server_fun(), rt_net_rpc(), rt_send_req_rel_port(), and soft_stub_fun().

Here is the call graph for this function:

int soft_rt_socket int  domain,
int  type,
int  protocol
 

Definition at line 1021 of file netrpc.c.

References cmpxchg, MaxSocks, and socks.

Referenced by __rtai_netrpc_init().

int soft_rt_socket_callback int  sock,
int(*  func)(int sock, void *arg),
void *  arg
 

Definition at line 1045 of file netrpc.c.

References sock_t::arg, sock_t::callback, and socks.

void soft_stub_fun struct portslot_t portslotp  )  [static]
 

Definition at line 351 of file netrpc.c.

References portslot_t::addr, ADRSZ, decode, encode, EXT, FUN, MAX_MSG_SIZE, nano2count(), RPC_RTR, RPC_SRV, rt_net_rpc_fun_ext, RT_SCHED_LINUX_PRIORITY, rt_sem_wait(), RT_TASK, portslot_t::sem, SEM, SEM_ERR, portslot_t::socket, soft_rt_fun_call(), soft_rt_genfun_call(), soft_rt_recvfrom(), soft_rt_sendto(), portslot_t::task, task, and TIMED.

Referenced by port_server_fun().

Here is the call graph for this function:

void softrtnet_hdl void   )  [static]
 

Definition at line 1441 of file netrpc.c.

Referenced by cleanup_softrtnet(), and init_softrtnet().

void thread_fun RT_TASK task  )  [static]
 

Definition at line 309 of file netrpc.c.

References get_min_tasks_cpuid(), RT_TASK, rt_task_suspend(), set_rtext(), soft_rt_fun_call(), and task.

Referenced by soft_kthread_init().

Here is the call graph for this function:

void timer_fun unsigned long  none  )  [static]
 

Definition at line 262 of file netrpc.c.

References NETRPC_TIMER_FREQ, rt_sem_signal(), timer, and timer_sem.

Referenced by __rtai_netrpc_init().

Here is the call graph for this function:

void trashmsg struct portslot_t portslotp,
int  hard
[static]
 

Definition at line 490 of file netrpc.c.

References hard_rt_recvfrom, MAX_MSG_SIZE, portslot_t::socket, and soft_rt_recvfrom().

Referenced by port_server_fun(), and rt_send_req_rel_port().

Here is the call graph for this function:


Variable Documentation

int(* decode)(struct portslot_t *portslotp, void *msg, int size, int where) [static]
 

Definition at line 272 of file netrpc.c.

Referenced by hard_stub_fun(), port_server_fun(), rt_net_rpc(), rt_send_req_rel_port(), set_netrpc_encoding(), and soft_stub_fun().

int(* encode)(struct portslot_t *portslotp, void *msg, int size, int where) [static]
 

Definition at line 271 of file netrpc.c.

Referenced by hard_stub_fun(), port_server_fun(), rt_net_rpc(), rt_send_req_rel_port(), set_netrpc_encoding(), and soft_stub_fun().

unsigned long end_softrtnet [static]
 

Definition at line 1396 of file netrpc.c.

Referenced by cleanup_softrtnet(), recv_thread(), and send_thread().

int errno
 

Definition at line 1098 of file netrpc.c.

Referenced by exec_conf(), rtf_create_named(), rtf_evdrp(), rtf_getfifobyname(), rtf_named_create(), rtf_open_sized(), rtf_overwrite(), rtf_read_all_at_once(), rtf_read_if(), rtf_read_timed(), rtf_reset(), rtf_resize(), rtf_sem_destroy(), rtf_sem_init(), rtf_sem_post(), rtf_sem_timed_wait(), rtf_sem_trywait(), rtf_sem_wait(), rtf_set_async_sig(), rtf_suspend_timed(), rtf_write_if(), rtf_write_timed(), sem_close_rt(), sem_init_rt(), and sem_trywait_rt().

int in
 

Definition at line 1056 of file netrpc.c.

unsigned long MaxSocks = MAX_SOCKS [static]
 

Definition at line 105 of file netrpc.c.

Referenced by __rtai_netrpc_exit(), __rtai_netrpc_init(), cleanup_softrtnet(), get_portslot(), init_softrtnet(), recv_thread(), rt_send_req_rel_port(), soft_rt_close(), soft_rt_recvfrom(), soft_rt_sendto(), and soft_rt_socket().

int MaxSockSrq [static]
 

Definition at line 1055 of file netrpc.c.

Referenced by init_softrtnet(), send_thread(), and soft_rt_sendto().

unsigned long MaxStubs = MAX_STUBS [static]
 

Definition at line 101 of file netrpc.c.

Referenced by __rtai_netrpc_exit(), __rtai_netrpc_init(), gvb_portslot(), and port_server_fun().

int MaxStubsMone [static]
 

Definition at line 103 of file netrpc.c.

Referenced by __rtai_netrpc_init(), hash_find(), hash_find_if_not_ins(), hash_fun(), hash_ins(), and hash_rem().

int mod_timer_srq [static]
 

Definition at line 577 of file netrpc.c.

Referenced by __rtai_netrpc_exit(), __rtai_netrpc_init(), and rt_send_req_rel_port().

int out
 

Definition at line 1056 of file netrpc.c.

struct pollfd* pollv [static]
 

Definition at line 1416 of file netrpc.c.

Referenced by cleanup_softrtnet(), init_softrtnet(), and recv_thread().

RT_TASK* port_server [static]
 

Definition at line 1007 of file netrpc.c.

Referenced by __rtai_netrpc_exit(), __rtai_netrpc_init(), and port_server_fun().

struct portslot_t* portslot [static]
 

Definition at line 129 of file netrpc.c.

Referenced by __rtai_netrpc_exit(), __rtai_netrpc_init(), get_portslot(), gvb_portslot(), hash_find(), hash_find_if_not_ins(), hash_ins(), hash_rem(), port_server_fun(), rt_find_asgn_stub(), rt_net_rpc(), rt_send_req_rel_port(), and rt_waiting_return().

spinlock_t portslot_lock = SPIN_LOCK_UNLOCKED [static]
 

Definition at line 127 of file netrpc.c.

Referenced by get_portslot(), and gvb_portslot().

volatile int portslotsp [static]
 

Definition at line 128 of file netrpc.c.

Referenced by __rtai_netrpc_init(), get_portslot(), and gvb_portslot().

struct task_struct* recv_handle [static]
 

Definition at line 1417 of file netrpc.c.

Referenced by init_softrtnet(), and recv_thread().

spinlock_t req_rel_lock = SPIN_LOCK_UNLOCKED [static]
 

Definition at line 161 of file netrpc.c.

Referenced by hash_find_if_not_ins(), hash_ins(), hash_rem(), and port_server_fun().

struct rt_fun_entry* rt_net_rpc_fun_ext[MAX_DFUN_EXT] [static]
 

Definition at line 121 of file netrpc.c.

Referenced by __rtai_netrpc_init(), hard_stub_fun(), rt_get_net_rpc_ret(), set_netrpc_encoding(), and soft_stub_fun().

void** rt_net_rpc_fun_hook = (void *)rt_net_rpc_fun_ext
 

Definition at line 1539 of file netrpc.c.

struct rt_native_fun_entry rt_netrpc_entries[]
 

Initial value:

{ { { 1, rt_net_rpc }, NETRPC }, { { 1, rt_send_req_rel_port }, SEND_REQ_REL_PORT }, { { 0, ddn2nl }, DDN2NL }, { { 0, rt_set_this_node }, SET_THIS_NODE }, { { 0, rt_find_asgn_stub }, FIND_ASGN_STUB }, { { 0, rt_rel_stub }, REL_STUB }, { { 0, rt_waiting_return }, WAITING_RETURN }, { { 0, 0 }, 000 } }
Definition at line 993 of file netrpc.c.

Referenced by __rtai_netrpc_exit(), and __rtai_netrpc_init().

int * sockindx
 

Definition at line 1056 of file netrpc.c.

struct sock_t* socks [static]
 

Definition at line 1019 of file netrpc.c.

Referenced by cleanup_softrtnet(), init_softrtnet(), recv_thread(), send_thread(), soft_rt_close(), soft_rt_recvfrom(), soft_rt_sendto(), soft_rt_socket(), and soft_rt_socket_callback().

struct sockaddr_in SPRT_ADDR [static]
 

Definition at line 130 of file netrpc.c.

Referenced by __rtai_netrpc_init(), init_softrtnet(), and rt_send_req_rel_port().

int srq
 

Definition at line 1056 of file netrpc.c.

Referenced by _rtai_lxrt(), handle_lxrt_request(), main(), rt_free_srq(), rt_pend_linux_srq(), rt_request_srq(), rtai_lxrt(), rtai_shmrq(), rtai_srq(), rtai_ssrq_trampoline(), rtai_syscall_entry(), rtai_syscall_trampoline(), rtai_usrq_trampoline(), and wake_up_srq_handler().

int StackSize = NETRPC_STACK_SIZE [static]
 

Definition at line 108 of file netrpc.c.

Referenced by port_server_fun().

void* sys_call_table[]
 

Referenced by kaccept(), kbind(), kconnect(), kgetpeername(), kgetsockname(), kgetsockopt(), klisten(), kpoll(), krecvfrom(), krecvmsg(), ksendmsg(), ksendto(), ksetsockopt(), kshutdown(), ksocket(), ksocketpair(), and lxrt_intercept_syscall_prologue().

struct { ... } sysrq [static]
 

Referenced by cleanup_softrtnet(), init_softrtnet(), send_thread(), and soft_rt_sendto().

spinlock_t sysrq_lock = SPIN_LOCK_UNLOCKED [static]
 

Definition at line 1057 of file netrpc.c.

Referenced by soft_rt_sendto().

unsigned long this_node[2] [static]
 

Definition at line 123 of file netrpc.c.

Referenced by __rtai_netrpc_init(), rt_send_req_rel_port(), and rt_set_this_node().

char* ThisHardNode = 0 [static]
 

Definition at line 117 of file netrpc.c.

Referenced by __rtai_netrpc_init().

char* ThisNode = LOCALHOST [static]
 

Definition at line 111 of file netrpc.c.

Referenced by __rtai_netrpc_init().

char* ThisSoftNode = 0 [static]
 

Definition at line 114 of file netrpc.c.

Referenced by __rtai_netrpc_init().

struct timer_list timer [static]
 

Definition at line 259 of file netrpc.c.

Referenced by __rtai_netrpc_exit(), __rtai_netrpc_init(), do_mod_timer(), and timer_fun().

SEM timer_sem [static]
 

Definition at line 260 of file netrpc.c.

Referenced by __rtai_netrpc_exit(), __rtai_netrpc_init(), rt_send_req_rel_port(), and timer_fun().


Generated on Thu Nov 20 11:55:14 2008 for RTAI API by doxygen 1.3.8