Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Variables
f_fs.c File Reference
#include <linux/blkdev.h>
#include <linux/pagemap.h>
#include <linux/export.h>
#include <linux/hid.h>
#include <asm/unaligned.h>
#include <linux/usb/composite.h>
#include <linux/usb/functionfs.h>

Go to the source code of this file.

Data Structures

struct  ffs_data
 
struct  ffs_data::ffs_file_perms
 
struct  ffs_ep
 
struct  ffs_epfile
 
struct  ffs_sb_fill_data
 

Macros

#define FUNCTIONFS_MAGIC   0xa647361 /* Chosen by a honest dice roll ;) */
 
#define pr_vdebug(...)   do { } while (0)
 
#define ffs_dump_mem(prefix, ptr, len)   do { } while (0)
 
#define ENTER()   pr_vdebug("%s()\n", __func__)
 
#define FFS_SETUP_STATE(ffs)
 
#define FFS_FL_CALL_CLOSED_CALLBACK   0
 
#define FFS_FL_BOUND   1
 
#define __entity_check_INTERFACE(val)   1
 
#define __entity_check_STRING(val)   (val)
 
#define __entity_check_ENDPOINT(val)   ((val) & USB_ENDPOINT_NUMBER_MASK)
 
#define __entity(type, val)
 

Typedefs

typedef int(* ffs_entity_callback )(enum ffs_entity_type entity, u8 *valuep, struct usb_descriptor_header *desc, void *priv)
 

Enumerations

enum  ffs_state {
  FFS_READ_DESCRIPTORS, FFS_READ_STRINGS, FFS_ACTIVE, FFS_CLOSING,
  FFS_READ_DESCRIPTORS, FFS_READ_STRINGS, FFS_ACTIVE, FFS_CLOSING
}
 
enum  ffs_setup_state {
  FFS_NO_SETUP, FFS_SETUP_PENDING, FFS_SETUP_CANCELED, FFS_NO_SETUP,
  FFS_SETUP_PENDING, FFS_SETUP_CANCELED
}
 
enum  ffs_entity_type {
  FFS_DESCRIPTOR, FFS_INTERFACE, FFS_STRING, FFS_ENDPOINT,
  FFS_DESCRIPTOR, FFS_INTERFACE, FFS_STRING, FFS_ENDPOINT
}
 

Variables

static int nonnull
 

Macro Definition Documentation

#define __entity (   type,
  val 
)
Value:
do { \
pr_vdebug("entity " #type "(%02x)\n", (val)); \
if (unlikely(!__entity_check_ ##type(val))) { \
pr_vdebug("invalid entity's value\n"); \
return -EINVAL; \
} \
ret = entity(FFS_ ##type, &val, _ds, priv); \
if (unlikely(ret < 0)) { \
pr_debug("entity " #type "(%02x); ret = %d\n", \
(val), ret); \
return ret; \
} \
} while (0)
#define __entity_check_ENDPOINT (   val)    ((val) & USB_ENDPOINT_NUMBER_MASK)
#define __entity_check_INTERFACE (   val)    1
#define __entity_check_STRING (   val)    (val)
#define ENTER ( )    pr_vdebug("%s()\n", __func__)

Definition at line 49 of file f_fs.c.

#define ffs_dump_mem (   prefix,
  ptr,
  len 
)    do { } while (0)

Definition at line 46 of file f_fs.c.

#define FFS_FL_BOUND   1

Definition at line 182 of file f_fs.c.

#define FFS_FL_CALL_CLOSED_CALLBACK   0

Definition at line 181 of file f_fs.c.

#define FFS_SETUP_STATE (   ffs)
Value:
((enum ffs_setup_state)cmpxchg(&(ffs)->setup_state, \
FFS_SETUP_CANCELED, FFS_NO_SETUP))

Definition at line 164 of file f_fs.c.

#define FUNCTIONFS_MAGIC   0xa647361 /* Chosen by a honest dice roll ;) */

Definition at line 31 of file f_fs.c.

#define pr_vdebug (   ...)    do { } while (0)

Definition at line 44 of file f_fs.c.

Typedef Documentation

typedef int(* ffs_entity_callback)(enum ffs_entity_type entity, u8 *valuep, struct usb_descriptor_header *desc, void *priv)

Definition at line 1611 of file f_fs.c.

Enumeration Type Documentation

Enumerator:
FFS_DESCRIPTOR 
FFS_INTERFACE 
FFS_STRING 
FFS_ENDPOINT 
FFS_DESCRIPTOR 
FFS_INTERFACE 
FFS_STRING 
FFS_ENDPOINT 

Definition at line 1607 of file f_fs.c.

Enumerator:
FFS_NO_SETUP 
FFS_SETUP_PENDING 
FFS_SETUP_CANCELED 
FFS_NO_SETUP 
FFS_SETUP_PENDING 
FFS_SETUP_CANCELED 

Definition at line 92 of file f_fs.c.

enum ffs_state
Enumerator:
FFS_READ_DESCRIPTORS 
FFS_READ_STRINGS 
FFS_ACTIVE 
FFS_CLOSING 
FFS_READ_DESCRIPTORS 
FFS_READ_STRINGS 
FFS_ACTIVE 
FFS_CLOSING 

Definition at line 54 of file f_fs.c.

Variable Documentation

char nonnull

Definition at line 342 of file f_fs.c.