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)  

aoedev.c File Reference
#include <linux/hdreg.h>
#include <linux/blkdev.h>
#include <linux/netdevice.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/bitmap.h>
#include <linux/kdev_t.h>
#include <linux/moduleparam.h>
#include "aoe.h"
Include dependency graph for aoedev.c:

Go to the source code of this file.

Macros

#define N_DEVS   ((1U<<MINORBITS)/AOE_PARTITIONS)
 

Enumerations

enum  flush_parms { NOT_EXITING = 0, EXITING = 1 }
 

Functions

static void dummy_timer (ulong)
 
static void freetgt (struct aoedev *d, struct aoetgt *t)
 
static void skbpoolfree (struct aoedev *d)
 
 module_param (aoe_dyndevs, int, 0644)
 
 MODULE_PARM_DESC (aoe_dyndevs, "Use dynamic minor numbers for devices.")
 
static DEFINE_SPINLOCK (devlist_lock)
 
static DEFINE_SPINLOCK (used_minors_lock)
 
static DECLARE_BITMAP (used_minors,((1U<< MINORBITS)/AOE_PARTITIONS))
 
static int minor_get_dyn (ulong *sysminor)
 
static int minor_get_static (ulong *sysminor, ulong aoemaj, int aoemin)
 
static int minor_get (ulong *sysminor, ulong aoemaj, int aoemin)
 
static void minor_free (ulong minor)
 
void aoedev_put (struct aoedev *d)
 
static void aoe_failip (struct aoedev *d)
 
static void downdev_frame (struct list_head *pos)
 
void aoedev_downdev (struct aoedev *d)
 
static int user_req (char *s, size_t slen, struct aoedev *d)
 
static void freedev (struct aoedev *d)
 
static int flush (const char __user *str, size_t cnt, int exiting)
 
int aoedev_flush (const char __user *str, size_t cnt)
 
static void skbfree (struct sk_buff *skb)
 
struct aoedevaoedev_by_aoeaddr (ulong maj, int min, int do_alloc)
 
void aoedev_exit (void)
 
int __init aoedev_init (void)
 

Variables

static int aoe_dyndevs = AOE_DYNDEVS
 
static struct aoedevdevlist
 

Macro Definition Documentation

◆ N_DEVS

#define N_DEVS   ((1U<<MINORBITS)/AOE_PARTITIONS)

Definition at line 35 of file aoedev.c.

Enumeration Type Documentation

◆ flush_parms

Enumerator
NOT_EXITING 
EXITING 

Definition at line 305 of file aoedev.c.

Function Documentation

◆ aoe_failip()

static void aoe_failip ( struct aoedev d)
static

Definition at line 163 of file aoedev.c.

References aoe_end_request(), aoe_failbuf(), aoedev::buf, aoedev::ip, aoedev::nxbio, and aoedev::rq.

Referenced by aoedev_downdev().

◆ aoedev_by_aoeaddr()

◆ aoedev_downdev()

◆ aoedev_exit()

void aoedev_exit ( void  )

Definition at line 524 of file aoedev.c.

References EXITING, and flush().

Referenced by aoe_exit(), and aoe_init().

◆ aoedev_flush()

int aoedev_flush ( const char __user *  str,
size_t  cnt 
)

Definition at line 394 of file aoedev.c.

References flush(), and NOT_EXITING.

Referenced by aoechr_write().

◆ aoedev_init()

int __init aoedev_init ( void  )

Definition at line 531 of file aoedev.c.

Referenced by aoe_init().

◆ aoedev_put()

void aoedev_put ( struct aoedev d)

◆ DECLARE_BITMAP()

static DECLARE_BITMAP ( used_minors  ,
((1U<< MINORBITS)/AOE_PARTITIONS)   
)
static

◆ DEFINE_SPINLOCK() [1/2]

static DEFINE_SPINLOCK ( devlist_lock  )
static

◆ DEFINE_SPINLOCK() [2/2]

static DEFINE_SPINLOCK ( used_minors_lock  )
static

◆ downdev_frame()

static void downdev_frame ( struct list_head *  pos)
static

Definition at line 185 of file aoedev.c.

References aoe_failbuf(), aoe_freetframe(), frame::buf, aoetgt::d, frame::head, buf::nframesout, and frame::t.

Referenced by aoedev_downdev().

◆ dummy_timer()

static void dummy_timer ( ulong  vp)
static

Definition at line 151 of file aoedev.c.

References DEVFL_TKILL, aoedev::flags, and aoedev::timer.

Referenced by aoedev_by_aoeaddr().

◆ flush()

static int flush ( const char __user *  str,
size_t  cnt,
int  exiting 
)
static

◆ freedev()

◆ freetgt()

static void freetgt ( struct aoedev d,
struct aoetgt t 
)
static

Definition at line 501 of file aoedev.c.

References aoetgt::ffree, aoetgt::ifs, NAOEIFS, aoeif::nd, frame::skb, and skbfree().

Referenced by freedev().

◆ minor_free()

static void minor_free ( ulong  minor)
static

Definition at line 116 of file aoedev.c.

References aoedev::flags, and N_DEVS.

Referenced by freedev().

◆ minor_get()

static int minor_get ( ulong sysminor,
ulong  aoemaj,
int  aoemin 
)
static

Definition at line 107 of file aoedev.c.

References aoe_dyndevs, minor_get_dyn(), minor_get_static(), and aoedev::sysminor.

Referenced by aoedev_by_aoeaddr().

◆ minor_get_dyn()

static int minor_get_dyn ( ulong sysminor)
static

Definition at line 41 of file aoedev.c.

References aoedev::flags, N_DEVS, and aoedev::sysminor.

Referenced by minor_get().

◆ minor_get_static()

static int minor_get_static ( ulong sysminor,
ulong  aoemaj,
int  aoemin 
)
static

Definition at line 60 of file aoedev.c.

References aoedev::flags, N_DEVS, and aoedev::sysminor.

Referenced by minor_get().

◆ module_param()

module_param ( aoe_dyndevs  ,
int  ,
0644   
)

◆ MODULE_PARM_DESC()

MODULE_PARM_DESC ( aoe_dyndevs  ,
"Use dynamic minor numbers for devices."   
)

◆ skbfree()

static void skbfree ( struct sk_buff *  skb)
static

Definition at line 405 of file aoedev.c.

Referenced by freetgt(), and skbpoolfree().

◆ skbpoolfree()

static void skbpoolfree ( struct aoedev d)
static

Definition at line 428 of file aoedev.c.

References skbfree(), aoedev::skbpool_hd, and aoedev::skbpool_tl.

Referenced by freedev().

◆ user_req()

static int user_req ( char *  s,
size_t  slen,
struct aoedev d 
)
static

Definition at line 245 of file aoedev.c.

References aoedev::gd.

Referenced by flush().

Variable Documentation

◆ aoe_dyndevs

int aoe_dyndevs = AOE_DYNDEVS
static

Definition at line 21 of file aoedev.c.

Referenced by minor_get().

◆ devlist

struct aoedev* devlist
static

Definition at line 25 of file aoedev.c.

Referenced by aoedev_by_aoeaddr(), and flush().