LMS 2012
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
d_usbdev.c File Reference
#include <asm/types.h>
#include "../../lms2012/source/lms2012.h"
#include "../../lms2012/source/am1808.h"
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/sched.h>
#include <linux/hrtimer.h>
#include <linux/mm.h>
#include <linux/init.h>
#include <linux/uaccess.h>
#include <linux/debugfs.h>
#include <linux/ioport.h>
#include <asm/gpio.h>
#include <asm/io.h>
#include <linux/module.h>
#include <linux/miscdevice.h>
#include <asm/uaccess.h>
#include <linux/hid.h>
#include <linux/utsname.h>
#include <linux/device.h>
#include "computil.c"
#include <../drivers/usb/gadget/gadget_chips.h>
#include <../drivers/usb/gadget/usbstring.c>
#include <../drivers/usb/gadget/config.c>
#include <../drivers/usb/gadget/epautoconf.c>
#include <../drivers/usb/gadget/g_zero.h>
#include "usb_function.c"

Go to the source code of this file.

Macros

#define MODULE_NAME   "usbdev_module"
 
#define DEVICE1_NAME   USBDEV_DEVICE
 
#define __USE_POSIX
 
#define MAX_EP_SIZE   1024
 
#define MAX_FULLSPEED_EP_SIZE   64
 
#define SHM_LENGTH   (sizeof(UsbSpeedDefault))
 
#define NPAGES   ((SHM_LENGTH + PAGE_SIZE - 1) / PAGE_SIZE)
 
#define DRIVER_VERSION   "31jan2011->"
 
#define DRIVER_VENDOR_NUM   0x0694
 
#define DRIVER_PRODUCT_NUM   0x0005
 
#define DEFAULT_AUTORESUME   0
 
#define STRING_MANUFACTURER_IDX   0
 
#define STRING_PRODUCT_IDX   1
 
#define STRING_SERIAL_IDX   2
 

Functions

 MODULE_LICENSE ("GPL")
 
 MODULE_AUTHOR ("The LEGO Group")
 
 MODULE_DESCRIPTION (MODULE_NAME)
 
 MODULE_SUPPORTED_DEVICE (DEVICE1_NAME)
 
 module_init (ModuleInit)
 
 module_exit (ModuleExit)
 
 module_param (buflen, uint, 0)
 
 module_param (loopdefault, bool, S_IRUGO|S_IWUSR)
 
 module_param (autoresume, uint, S_IRUGO)
 
 MODULE_PARM_DESC (autoresume,"zero, or seconds before remote wakeup")
 
struct usb_request * alloc_ep_req (struct usb_ep *ep)
 
void free_ep_req (struct usb_ep *ep, struct usb_request *req)
 
void disable_endpoints (struct usb_composite_dev *cdev, struct usb_ep *in, struct usb_ep *out)
 
 module_param (HostStr, charp, 0)
 
 module_param (SerialStr, charp, 0)
 

Variables

unsigned buflen = MAX_EP_SIZE
 
char usb_char_buffer_in [MAX_EP_SIZE]
 
char usb_full_buffer_in [MAX_FULLSPEED_EP_SIZE]
 
int usb_char_in_length = 0
 
char usb_char_buffer_out [MAX_EP_SIZE]
 
char usb_full_buffer_out [MAX_FULLSPEED_EP_SIZE]
 
int usb_char_out_length = 0
 
unsigned autoresume = DEFAULT_AUTORESUME
 
char * HostStr
 
char * SerialStr
 

Macro Definition Documentation

#define __USE_POSIX

Definition at line 55 of file d_usbdev.c.

#define DEFAULT_AUTORESUME   0

Definition at line 150 of file d_usbdev.c.

#define DEVICE1_NAME   USBDEV_DEVICE

Definition at line 48 of file d_usbdev.c.

#define DRIVER_PRODUCT_NUM   0x0005

Definition at line 149 of file d_usbdev.c.

#define DRIVER_VENDOR_NUM   0x0694

Definition at line 148 of file d_usbdev.c.

#define DRIVER_VERSION   "31jan2011->"

Definition at line 133 of file d_usbdev.c.

#define MAX_EP_SIZE   1024

Definition at line 101 of file d_usbdev.c.

#define MAX_FULLSPEED_EP_SIZE   64

Definition at line 102 of file d_usbdev.c.

#define MODULE_NAME   "usbdev_module"

Definition at line 47 of file d_usbdev.c.

#define NPAGES   ((SHM_LENGTH + PAGE_SIZE - 1) / PAGE_SIZE)

Definition at line 112 of file d_usbdev.c.

#define SHM_LENGTH   (sizeof(UsbSpeedDefault))

Definition at line 111 of file d_usbdev.c.

#define STRING_MANUFACTURER_IDX   0

Definition at line 202 of file d_usbdev.c.

#define STRING_PRODUCT_IDX   1

Definition at line 203 of file d_usbdev.c.

#define STRING_SERIAL_IDX   2

Definition at line 204 of file d_usbdev.c.

Function Documentation

struct usb_request* alloc_ep_req ( struct usb_ep *  ep)

Definition at line 229 of file d_usbdev.c.

void disable_endpoints ( struct usb_composite_dev *  cdev,
struct usb_ep *  in,
struct usb_ep *  out 
)

Definition at line 264 of file d_usbdev.c.

void free_ep_req ( struct usb_ep *  ep,
struct usb_request *  req 
)

Definition at line 245 of file d_usbdev.c.

MODULE_AUTHOR ( "The LEGO Group"  )
MODULE_DESCRIPTION ( MODULE_NAME  )
module_exit ( ModuleExit  )
module_init ( ModuleInit  )
MODULE_LICENSE ( "GPL"  )
module_param ( buflen  ,
uint  ,
 
)
module_param ( loopdefault  ,
bool  ,
S_IRUGO|  S_IWUSR 
)
module_param ( autoresume  ,
uint  ,
S_IRUGO   
)
module_param ( HostStr  ,
charp  ,
 
)
module_param ( SerialStr  ,
charp  ,
 
)
MODULE_PARM_DESC ( autoresume  ,
zero,
or seconds before remote wakeup"   
)
MODULE_SUPPORTED_DEVICE ( DEVICE1_NAME  )

Variable Documentation

unsigned autoresume = DEFAULT_AUTORESUME

Definition at line 157 of file d_usbdev.c.

unsigned buflen = MAX_EP_SIZE

Definition at line 103 of file d_usbdev.c.

char* HostStr

Definition at line 627 of file d_usbdev.c.

char* SerialStr

Definition at line 628 of file d_usbdev.c.

char usb_char_buffer_in[MAX_EP_SIZE]

Definition at line 104 of file d_usbdev.c.

char usb_char_buffer_out[MAX_EP_SIZE]

Definition at line 107 of file d_usbdev.c.

int usb_char_in_length = 0

Definition at line 106 of file d_usbdev.c.

int usb_char_out_length = 0

Definition at line 109 of file d_usbdev.c.

char usb_full_buffer_in[MAX_FULLSPEED_EP_SIZE]

Definition at line 105 of file d_usbdev.c.

char usb_full_buffer_out[MAX_FULLSPEED_EP_SIZE]

Definition at line 108 of file d_usbdev.c.