aoe  87
About: AoE (ATA over Ethernet) Protocol Driver (Linux kernel 4.8.x and greater are not supported).
  Fossies Dox: aoe-87.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

aoenet.c File Reference
#include <linux/hdreg.h>
#include <linux/blkdev.h>
#include <linux/netdevice.h>
#include <linux/moduleparam.h>
#include <net/net_namespace.h>
#include <asm/unaligned.h>
#include "aoe.h"
Include dependency graph for aoenet.c:

Go to the source code of this file.

Macros

#define NECODES   5
 

Enumerations

enum  { IFLISTSZ = 1024 }
 

Functions

 module_param_string (aoe_iflist, aoe_iflist, IFLISTSZ, 0600)
 
 MODULE_PARM_DESC (aoe_iflist, "aoe_iflist=dev1[,dev2...]\n")
 
static int __init aoe_iflist_setup (char *str)
 
 __setup ("aoe_iflist=", aoe_iflist_setup)
 
static int tx (int id)
 
static size_t aoe_strcspn (const char *s, const char *reject)
 
int is_aoe_netif (struct net_device *ifp)
 
int set_aoe_iflist (const char __user *user_str, size_t size)
 
unsigned long long mac_addr (char addr[6])
 
void aoenet_xmit (struct sk_buff *sl)
 
static int aoenet_rcv (struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt, struct net_device *orig_dev)
 
int __init aoenet_init (void)
 
void aoenet_exit (void)
 

Variables

static char * aoe_errlist []
 
static char aoe_iflist [IFLISTSZ]
 
static wait_queue_head_t txwq
 
static struct ktstate kts
 
static spinlock_t txlock
 
static struct sk_buff_head skbtxq
 
static struct packet_type aoe_pt
 

Macro Definition Documentation

◆ NECODES

#define NECODES   5

Definition at line 15 of file aoenet.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
IFLISTSZ 

Definition at line 27 of file aoenet.c.

Function Documentation

◆ __setup()

__setup ( )

◆ aoe_iflist_setup()

static int __init aoe_iflist_setup ( char *  str)
static

Definition at line 39 of file aoenet.c.

References aoe_iflist, and IFLISTSZ.

◆ aoe_strcspn()

static size_t aoe_strcspn ( const char *  s,
const char *  reject 
)
static

Definition at line 90 of file aoenet.c.

Referenced by is_aoe_netif().

◆ aoenet_exit()

void aoenet_exit ( void  )

Definition at line 261 of file aoenet.c.

References aoe_ktstop(), aoe_pt, kts, and skbtxq.

Referenced by aoe_exit(), and aoe_init().

◆ aoenet_init()

int __init aoenet_init ( void  )

Definition at line 244 of file aoenet.c.

References aoe_ktstart(), aoe_pt, ktstate::fn, ktstate::id, kts, ktstate::lock, ktstate::name, skbtxq, tx(), txlock, txwq, and ktstate::waitq.

Referenced by aoe_init().

◆ aoenet_rcv()

static int aoenet_rcv ( struct sk_buff *  skb,
struct net_device *  ifp,
struct packet_type *  pt,
struct net_device *  orig_dev 
)
static

◆ aoenet_xmit()

void aoenet_xmit ( struct sk_buff *  sl)

Definition at line 159 of file aoenet.c.

References skbtxq, txlock, and txwq.

Referenced by aoecmd_ata_rw(), aoecmd_cfg(), aoecmd_cfg_rsp(), probe(), resend(), and revalidate().

◆ is_aoe_netif()

int is_aoe_netif ( struct net_device *  ifp)

Definition at line 108 of file aoenet.c.

References aoe_iflist, aoe_strcspn(), and WHITESPACE.

Referenced by aoecmd_cfg_pkts(), and aoenet_rcv().

◆ mac_addr()

unsigned long long mac_addr ( char  addr[6])

Definition at line 148 of file aoenet.c.

Referenced by aoecmd_ata_rsp(), aoedisk_show_mac(), ataid_complete(), probe(), and resend().

◆ module_param_string()

module_param_string ( aoe_iflist  ,
aoe_iflist  ,
IFLISTSZ  ,
0600   
)

◆ MODULE_PARM_DESC()

MODULE_PARM_DESC ( aoe_iflist  ,
aoe_iflist = dev1[,
dev2...]\n"   
)

◆ set_aoe_iflist()

int set_aoe_iflist ( const char __user *  user_str,
size_t  size 
)

Definition at line 134 of file aoenet.c.

References aoe_iflist, and IFLISTSZ.

Referenced by interfaces().

◆ tx()

static int tx ( int  id)
static

Definition at line 54 of file aoenet.c.

References aoe_atahdr::aflags, AOEAFL_WRITE, skbtxq, and txlock.

Referenced by aoenet_init().

Variable Documentation

◆ aoe_errlist

char* aoe_errlist[]
static
Initial value:
=
{
"no such error",
"unrecognized command code",
"bad argument parameter",
"device unavailable",
"config string present",
"unsupported version"
}

Definition at line 17 of file aoenet.c.

Referenced by aoenet_rcv().

◆ aoe_iflist

char aoe_iflist[IFLISTSZ]
static

Definition at line 31 of file aoenet.c.

Referenced by aoe_iflist_setup(), is_aoe_netif(), and set_aoe_iflist().

◆ aoe_pt

struct packet_type aoe_pt
static
Initial value:
= {
.type = __constant_htons( 0x88a2 ),
.func = aoenet_rcv,
}

Definition at line 238 of file aoenet.c.

Referenced by aoenet_exit(), and aoenet_init().

◆ kts

struct ktstate kts
static

Definition at line 36 of file aoenet.c.

Referenced by aoenet_exit(), and aoenet_init().

◆ skbtxq

struct sk_buff_head skbtxq
static

Definition at line 50 of file aoenet.c.

Referenced by aoenet_exit(), aoenet_init(), aoenet_xmit(), and tx().

◆ txlock

spinlock_t txlock
static

Definition at line 49 of file aoenet.c.

Referenced by aoenet_init(), aoenet_xmit(), and tx().

◆ txwq

wait_queue_head_t txwq
static

Definition at line 35 of file aoenet.c.

Referenced by aoenet_init(), and aoenet_xmit().

aoenet_rcv
static int aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt, struct net_device *orig_dev)
Definition: aoenet.c:178