Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
mon_bin.c File Reference
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/fs.h>
#include <linux/cdev.h>
#include <linux/export.h>
#include <linux/usb.h>
#include <linux/poll.h>
#include <linux/compat.h>
#include <linux/mm.h>
#include <linux/scatterlist.h>
#include <linux/slab.h>
#include <asm/uaccess.h>
#include "usb_mon.h"

Go to the source code of this file.

Data Structures

struct  mon_bin_hdr
 
struct  mon_bin_isodesc
 
struct  mon_bin_stats
 
struct  mon_bin_get
 
struct  mon_bin_mfetch
 
struct  mon_pgmap
 
struct  mon_reader_bin
 

Macros

#define SETUP_LEN   8
 
#define MON_IOC_MAGIC   0x92
 
#define MON_IOCQ_URB_LEN   _IO(MON_IOC_MAGIC, 1)
 
#define MON_IOCG_STATS   _IOR(MON_IOC_MAGIC, 3, struct mon_bin_stats)
 
#define MON_IOCT_RING_SIZE   _IO(MON_IOC_MAGIC, 4)
 
#define MON_IOCQ_RING_SIZE   _IO(MON_IOC_MAGIC, 5)
 
#define MON_IOCX_GET   _IOW(MON_IOC_MAGIC, 6, struct mon_bin_get)
 
#define MON_IOCX_MFETCH   _IOWR(MON_IOC_MAGIC, 7, struct mon_bin_mfetch)
 
#define MON_IOCH_MFLUSH   _IO(MON_IOC_MAGIC, 8)
 
#define MON_IOCX_GETX   _IOW(MON_IOC_MAGIC, 10, struct mon_bin_get)
 
#define CHUNK_SIZE   PAGE_SIZE
 
#define CHUNK_ALIGN(x)   (((x)+CHUNK_SIZE-1) & ~(CHUNK_SIZE-1))
 
#define BUFF_MAX   CHUNK_ALIGN(1200*1024)
 
#define BUFF_DFL   CHUNK_ALIGN(300*1024)
 
#define BUFF_MIN   CHUNK_ALIGN(8*1024)
 
#define PKT_ALIGN   64
 
#define PKT_SIZE   64
 
#define PKT_SZ_API0   48 /* API 0 (2.6.20) size */
 
#define PKT_SZ_API1   64 /* API 1 size: extra fields */
 
#define ISODESC_MAX   128 /* Same number as usbfs allows, 2048 bytes. */
 
#define MON_BIN_MAX_MINOR   128
 
#define MON_RING_EMPTY(rp)   ((rp)->b_cnt == 0)
 

Functions

int mon_bin_add (struct mon_bus *mbus, const struct usb_bus *ubus)
 
void mon_bin_del (struct mon_bus *mbus)
 
int __init mon_bin_init (void)
 
void mon_bin_exit (void)
 

Macro Definition Documentation

#define BUFF_DFL   CHUNK_ALIGN(300*1024)

Definition at line 78 of file mon_bin.c.

#define BUFF_MAX   CHUNK_ALIGN(1200*1024)

Definition at line 77 of file mon_bin.c.

#define BUFF_MIN   CHUNK_ALIGN(8*1024)

Definition at line 79 of file mon_bin.c.

#define CHUNK_ALIGN (   x)    (((x)+CHUNK_SIZE-1) & ~(CHUNK_SIZE-1))

Definition at line 62 of file mon_bin.c.

#define CHUNK_SIZE   PAGE_SIZE

Definition at line 61 of file mon_bin.c.

#define ISODESC_MAX   128 /* Same number as usbfs allows, 2048 bytes. */

Definition at line 164 of file mon_bin.c.

#define MON_BIN_MAX_MINOR   128

Definition at line 167 of file mon_bin.c.

#define MON_IOC_MAGIC   0x92

Definition at line 32 of file mon_bin.c.

#define MON_IOCG_STATS   _IOR(MON_IOC_MAGIC, 3, struct mon_bin_stats)

Definition at line 36 of file mon_bin.c.

#define MON_IOCH_MFLUSH   _IO(MON_IOC_MAGIC, 8)

Definition at line 41 of file mon_bin.c.

#define MON_IOCQ_RING_SIZE   _IO(MON_IOC_MAGIC, 5)

Definition at line 38 of file mon_bin.c.

#define MON_IOCQ_URB_LEN   _IO(MON_IOC_MAGIC, 1)

Definition at line 34 of file mon_bin.c.

#define MON_IOCT_RING_SIZE   _IO(MON_IOC_MAGIC, 4)

Definition at line 37 of file mon_bin.c.

#define MON_IOCX_GET   _IOW(MON_IOC_MAGIC, 6, struct mon_bin_get)

Definition at line 39 of file mon_bin.c.

#define MON_IOCX_GETX   _IOW(MON_IOC_MAGIC, 10, struct mon_bin_get)

Definition at line 43 of file mon_bin.c.

#define MON_IOCX_MFETCH   _IOWR(MON_IOC_MAGIC, 7, struct mon_bin_mfetch)

Definition at line 40 of file mon_bin.c.

#define MON_RING_EMPTY (   rp)    ((rp)->b_cnt == 0)

Definition at line 207 of file mon_bin.c.

#define PKT_ALIGN   64

Definition at line 158 of file mon_bin.c.

#define PKT_SIZE   64

Definition at line 159 of file mon_bin.c.

#define PKT_SZ_API0   48 /* API 0 (2.6.20) size */

Definition at line 161 of file mon_bin.c.

#define PKT_SZ_API1   64 /* API 1 size: extra fields */

Definition at line 162 of file mon_bin.c.

#define SETUP_LEN   8

Definition at line 29 of file mon_bin.c.

Function Documentation

int mon_bin_add ( struct mon_bus mbus,
const struct usb_bus *  ubus 
)

Definition at line 1330 of file mon_bin.c.

void mon_bin_del ( struct mon_bus mbus)

Definition at line 1348 of file mon_bin.c.

void mon_bin_exit ( void  )

Definition at line 1384 of file mon_bin.c.

int __init mon_bin_init ( void  )

Definition at line 1353 of file mon_bin.c.