Classes | Defines | Functions | Variables
main.c File Reference
#include <linux/kernel.h>
#include <asm/delay.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/kthread.h>
#include <linux/inetdevice.h>
#include <linux/ip.h>
#include <linux/tcp.h>
#include <linux/udp.h>
#include <linux/types.h>
#include <linux/kdev_t.h>
#include <linux/fs.h>
#include <linux/device.h>
#include <linux/cdev.h>
#include "ioctl.h"
#include "conf.h"
#include "../include/ioctl_interface.h"
#include "../include/cross_space.h"
#include "core/interface/wmp_interface.h"
#include "core/include/frames.h"
#include "core/include/queues.h"
Include dependency graph for src/platforms/linux_ks/net_device/main.c:

Go to the source code of this file.

Classes

struct  priv_data

Defines

#define IP_TRAFFIC_PORT   0
#define IP_TRAFFIC_PRIORITY   0

Functions

static int ch_open (struct inode *inode, struct file *file)
static ssize_t ch_read (struct file *filp, char *buffer, size_t length, loff_t *offset)
static ssize_t ch_write (struct file *filp, const char *buff, size_t len, loff_t *off)
static void chdev_finish (void)
static int chdev_init (void)
 DEFINE_MUTEX (chr_dev_mtx)
static int device_open (struct inode *inode, struct file *file)
static int device_release (struct inode *inode, struct file *file)
static tpTraffic getMsgType (struct net_device *netdev, char *data, unsigned int dest, signed char *priority)
static int interface_close (struct net_device *netdev)
static int interface_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd)
static int interface_open (struct net_device *netdev)
static int interface_tx (struct sk_buff *skb, struct net_device *netdev)
static void interface_tx_timeout (struct net_device *dev)
static int __net_init load_interface (void)
 MODULE_AUTHOR ("Rubén Durán and Danilo Tardioli")
 MODULE_DESCRIPTION ("IP interface for RT-WMP")
 module_exit (unload_interface)
 module_init (load_interface)
 MODULE_LICENSE ("GPL")
 MODULE_VERSION ("")
int queue_thread_func (void *data)
int rx_msg (char *p, unsigned int size)
int rx_thread_func (void *data)
static int send_msg (struct net_device *netdev, unsigned int port, char *p, unsigned int size, unsigned int dest, signed char priority)
static void __net_exit unload_interface (void)
void ussleep (unsigned int usecs)

Variables

static struct cdev c_dev
static struct class * cl
static dev_t first
static struct file_operations fops
static struct net_device * interface
static struct net_device_ops interfaz_netdev_ops

Define Documentation

#define IP_TRAFFIC_PORT   0

Definition at line 51 of file src/platforms/linux_ks/net_device/main.c.

#define IP_TRAFFIC_PRIORITY   0

Definition at line 52 of file src/platforms/linux_ks/net_device/main.c.


Function Documentation

static int ch_open ( struct inode *  inode,
struct file *  file 
) [static]

Definition at line 198 of file src/platforms/linux_ks/net_device/main.c.

static ssize_t ch_read ( struct file *  filp,
char *  buffer,
size_t  length,
loff_t *  offset 
) [static]

Definition at line 202 of file src/platforms/linux_ks/net_device/main.c.

static ssize_t ch_write ( struct file *  filp,
const char *  buff,
size_t  len,
loff_t *  off 
) [static]

Definition at line 231 of file src/platforms/linux_ks/net_device/main.c.

static void chdev_finish ( void  ) [static]

Definition at line 267 of file src/platforms/linux_ks/net_device/main.c.

static int chdev_init ( void  ) [static]

Definition at line 243 of file src/platforms/linux_ks/net_device/main.c.

DEFINE_MUTEX ( chr_dev_mtx  )
static int device_open ( struct inode *  inode,
struct file *  file 
) [static]

Definition at line 190 of file src/platforms/linux_ks/net_device/main.c.

static int device_release ( struct inode *  inode,
struct file *  file 
) [static]

Definition at line 194 of file src/platforms/linux_ks/net_device/main.c.

static tpTraffic getMsgType ( struct net_device *  netdev,
char *  data,
unsigned int  dest,
signed char *  priority 
) [static]

Returns the type of the message pointed by m Some types will only be returned if the proper plugin is being used If there is a matching configuration, the priority of the message will be set to the one in the configuration.

Definition at line 427 of file src/platforms/linux_ks/net_device/main.c.

static int __devexit interface_close ( struct net_device *  netdev) [static]

Definition at line 402 of file src/platforms/linux_ks/net_device/main.c.

static int interface_ioctl ( struct net_device *  dev,
struct ifreq *  ifr,
int  cmd 
) [static]

This function is used to provide direct access to the RT-WMP protocol though IOCTL calls

Definition at line 580 of file src/platforms/linux_ks/net_device/main.c.

static int __devinit interface_open ( struct net_device *  netdev) [static]

Definition at line 334 of file src/platforms/linux_ks/net_device/main.c.

static int interface_tx ( struct sk_buff skb,
struct net_device *  netdev 
) [static]

Definition at line 513 of file src/platforms/linux_ks/net_device/main.c.

static void interface_tx_timeout ( struct net_device *  dev) [static]

Definition at line 627 of file src/platforms/linux_ks/net_device/main.c.

static int __net_init load_interface ( void  ) [static]

Definition at line 276 of file src/platforms/linux_ks/net_device/main.c.

MODULE_AUTHOR ( "Rubén Durán and Danilo Tardioli"  )
MODULE_DESCRIPTION ( "IP interface for RT-WMP"  )
MODULE_LICENSE ( "GPL"  )
MODULE_VERSION ( ""  )
int queue_thread_func ( void *  data)

This thread starts the transmission queue periodically in case it has been stopped by the flow control

Definition at line 146 of file src/platforms/linux_ks/net_device/main.c.

int rx_msg ( char *  p,
unsigned int  size 
)

Creates a skb with the data in 'm' and calls netif_receive_skb()

Definition at line 101 of file src/platforms/linux_ks/net_device/main.c.

int rx_thread_func ( void *  data)

Thread for the reception of normal and broadcast messages (queue number 1)

Definition at line 165 of file src/platforms/linux_ks/net_device/main.c.

static int send_msg ( struct net_device *  netdev,
unsigned int  port,
char *  p,
unsigned int  size,
unsigned int  dest,
signed char  priority 
) [static]

Sends the message pointed by m, taking into account its type to choose the function to use for the transmission

Definition at line 494 of file src/platforms/linux_ks/net_device/main.c.

static void __net_exit unload_interface ( void  ) [static]

Definition at line 324 of file src/platforms/linux_ks/net_device/main.c.

void ussleep ( unsigned int  usecs)

Definition at line 155 of file src/platforms/linux_ks/net_device/main.c.


Variable Documentation

struct cdev c_dev [static]

Definition at line 57 of file src/platforms/linux_ks/net_device/main.c.

struct class* cl [static]

Definition at line 58 of file src/platforms/linux_ks/net_device/main.c.

dev_t first [static]

Definition at line 56 of file src/platforms/linux_ks/net_device/main.c.

struct file_operations fops [static]
Initial value:
 { .open = device_open, .release =
                device_release, .read = ch_read, .write = ch_write, .open = ch_open, .owner = THIS_MODULE,
}

Definition at line 94 of file src/platforms/linux_ks/net_device/main.c.

struct net_device* interface [static]

Definition at line 55 of file src/platforms/linux_ks/net_device/main.c.

struct net_device_ops interfaz_netdev_ops [static]
Initial value:
 { .ndo_open =
                interface_open, .ndo_stop = interface_close, .ndo_start_xmit =
                interface_tx, .ndo_do_ioctl = interface_ioctl, .ndo_tx_timeout =
                interface_tx_timeout, }

Definition at line 79 of file src/platforms/linux_ks/net_device/main.c.



ros_rt_wmp
Author(s): Danilo Tardioli, dantard@unizar.es
autogenerated on Fri Jan 3 2014 12:07:57