Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
ftdi-elan.c File Reference
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/list.h>
#include <linux/ioctl.h>
#include <linux/pci_ids.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/kref.h>
#include <linux/mutex.h>
#include <asm/uaccess.h>
#include <linux/usb.h>
#include <linux/workqueue.h>
#include <linux/platform_device.h>
#include "usb_u132.h"
#include <asm/io.h>
#include <linux/usb/hcd.h>
#include "../host/ohci.h"

Go to the source code of this file.

Data Structures

struct  u132_command
 
struct  u132_respond
 
struct  u132_target
 
struct  usb_ftdi
 

Macros

#define INT_MODULE_PARM(n, v)   static int n = v;module_param(n, int, 0444)
 
#define USB_FTDI_ELAN_VENDOR_ID   0x0403
 
#define USB_FTDI_ELAN_PRODUCT_ID   0xd6ea
 
#define USB_FTDI_ELAN_MINOR_BASE   192
 
#define COMMAND_BITS   5
 
#define COMMAND_SIZE   (1<<COMMAND_BITS)
 
#define COMMAND_MASK   (COMMAND_SIZE-1)
 
#define RESPOND_BITS   5
 
#define RESPOND_SIZE   (1<<RESPOND_BITS)
 
#define RESPOND_MASK   (RESPOND_SIZE-1)
 
#define kref_to_usb_ftdi(d)   container_of(d, struct usb_ftdi, kref)
 
#define platform_device_to_usb_ftdi(d)
 
#define cPCIu132rd   0x0
 
#define cPCIu132wr   0x1
 
#define cPCIiord   0x2
 
#define cPCIiowr   0x3
 
#define cPCImemrd   0x6
 
#define cPCImemwr   0x7
 
#define cPCIcfgrd   0xA
 
#define cPCIcfgwr   0xB
 
#define cPCInull   0xF
 
#define cU132cmd_status   0x0
 
#define cU132flash   0x1
 
#define cPIDsetup   0x0
 
#define cPIDout   0x1
 
#define cPIDin   0x2
 
#define cPIDinonce   0x3
 
#define cCCnoerror   0x0
 
#define cCCcrc   0x1
 
#define cCCbitstuff   0x2
 
#define cCCtoggle   0x3
 
#define cCCstall   0x4
 
#define cCCnoresp   0x5
 
#define cCCbadpid1   0x6
 
#define cCCbadpid2   0x7
 
#define cCCdataoverrun   0x8
 
#define cCCdataunderrun   0x9
 
#define cCCbuffoverrun   0xC
 
#define cCCbuffunderrun   0xD
 
#define cCCnotaccessed   0xF
 
#define ftdi_read_pcimem(ftdi, member, data)
 
#define ftdi_write_pcimem(ftdi, member, data)
 
#define OHCI_CONTROL_INIT   OHCI_CTRL_CBSR
 
#define OHCI_INTR_INIT
 

Functions

 MODULE_AUTHOR ("Tony Olech")
 
 MODULE_DESCRIPTION ("FTDI ELAN driver")
 
 MODULE_LICENSE ("GPL")
 
 module_param (distrust_firmware, bool, 0)
 
 MODULE_PARM_DESC (distrust_firmware,"true to distrust firmware power/overcurren""t setup")
 
 MODULE_DEVICE_TABLE (usb, ftdi_elan_table)
 
void ftdi_elan_gone_away (struct platform_device *pdev)
 
 EXPORT_SYMBOL_GPL (ftdi_elan_gone_away)
 
int usb_ftdi_elan_write_pcimem (struct platform_device *pdev, int mem_offset, u8 width, u32 data)
 
 EXPORT_SYMBOL_GPL (usb_ftdi_elan_write_pcimem)
 
int usb_ftdi_elan_read_pcimem (struct platform_device *pdev, int mem_offset, u8 width, u32 *data)
 
 EXPORT_SYMBOL_GPL (usb_ftdi_elan_read_pcimem)
 
int usb_ftdi_elan_edset_setup (struct platform_device *pdev, u8 ed_number, void *endp, struct urb *urb, u8 address, u8 ep_number, u8 toggle_bits, void(*callback)(void *endp, struct urb *urb, u8 *buf, int len, int toggle_bits, int error_count, int condition_code, int repeat_number, int halted, int skipped, int actual, int non_null))
 
 EXPORT_SYMBOL_GPL (usb_ftdi_elan_edset_setup)
 
int usb_ftdi_elan_edset_input (struct platform_device *pdev, u8 ed_number, void *endp, struct urb *urb, u8 address, u8 ep_number, u8 toggle_bits, void(*callback)(void *endp, struct urb *urb, u8 *buf, int len, int toggle_bits, int error_count, int condition_code, int repeat_number, int halted, int skipped, int actual, int non_null))
 
 EXPORT_SYMBOL_GPL (usb_ftdi_elan_edset_input)
 
int usb_ftdi_elan_edset_empty (struct platform_device *pdev, u8 ed_number, void *endp, struct urb *urb, u8 address, u8 ep_number, u8 toggle_bits, void(*callback)(void *endp, struct urb *urb, u8 *buf, int len, int toggle_bits, int error_count, int condition_code, int repeat_number, int halted, int skipped, int actual, int non_null))
 
 EXPORT_SYMBOL_GPL (usb_ftdi_elan_edset_empty)
 
int usb_ftdi_elan_edset_output (struct platform_device *pdev, u8 ed_number, void *endp, struct urb *urb, u8 address, u8 ep_number, u8 toggle_bits, void(*callback)(void *endp, struct urb *urb, u8 *buf, int len, int toggle_bits, int error_count, int condition_code, int repeat_number, int halted, int skipped, int actual, int non_null))
 
 EXPORT_SYMBOL_GPL (usb_ftdi_elan_edset_output)
 
int usb_ftdi_elan_edset_single (struct platform_device *pdev, u8 ed_number, void *endp, struct urb *urb, u8 address, u8 ep_number, u8 toggle_bits, void(*callback)(void *endp, struct urb *urb, u8 *buf, int len, int toggle_bits, int error_count, int condition_code, int repeat_number, int halted, int skipped, int actual, int non_null))
 
 EXPORT_SYMBOL_GPL (usb_ftdi_elan_edset_single)
 
int usb_ftdi_elan_edset_flush (struct platform_device *pdev, u8 ed_number, void *endp)
 
 EXPORT_SYMBOL_GPL (usb_ftdi_elan_edset_flush)
 
 module_init (ftdi_elan_init)
 
 module_exit (ftdi_elan_exit)
 

Variables

struct platform_driver u132_platform_driver
 

Macro Definition Documentation

#define cCCbadpid1   0x6

Definition at line 1245 of file ftdi-elan.c.

#define cCCbadpid2   0x7

Definition at line 1246 of file ftdi-elan.c.

#define cCCbitstuff   0x2

Definition at line 1241 of file ftdi-elan.c.

#define cCCbuffoverrun   0xC

Definition at line 1249 of file ftdi-elan.c.

#define cCCbuffunderrun   0xD

Definition at line 1250 of file ftdi-elan.c.

#define cCCcrc   0x1

Definition at line 1240 of file ftdi-elan.c.

#define cCCdataoverrun   0x8

Definition at line 1247 of file ftdi-elan.c.

#define cCCdataunderrun   0x9

Definition at line 1248 of file ftdi-elan.c.

#define cCCnoerror   0x0

Definition at line 1239 of file ftdi-elan.c.

#define cCCnoresp   0x5

Definition at line 1244 of file ftdi-elan.c.

#define cCCnotaccessed   0xF

Definition at line 1251 of file ftdi-elan.c.

#define cCCstall   0x4

Definition at line 1243 of file ftdi-elan.c.

#define cCCtoggle   0x3

Definition at line 1242 of file ftdi-elan.c.

#define COMMAND_BITS   5

Definition at line 107 of file ftdi-elan.c.

#define COMMAND_MASK   (COMMAND_SIZE-1)

Definition at line 109 of file ftdi-elan.c.

#define COMMAND_SIZE   (1<<COMMAND_BITS)

Definition at line 108 of file ftdi-elan.c.

#define cPCIcfgrd   0xA

Definition at line 1230 of file ftdi-elan.c.

#define cPCIcfgwr   0xB

Definition at line 1231 of file ftdi-elan.c.

#define cPCIiord   0x2

Definition at line 1226 of file ftdi-elan.c.

#define cPCIiowr   0x3

Definition at line 1227 of file ftdi-elan.c.

#define cPCImemrd   0x6

Definition at line 1228 of file ftdi-elan.c.

#define cPCImemwr   0x7

Definition at line 1229 of file ftdi-elan.c.

#define cPCInull   0xF

Definition at line 1232 of file ftdi-elan.c.

#define cPCIu132rd   0x0

Definition at line 1224 of file ftdi-elan.c.

#define cPCIu132wr   0x1

Definition at line 1225 of file ftdi-elan.c.

#define cPIDin   0x2

Definition at line 1237 of file ftdi-elan.c.

#define cPIDinonce   0x3

Definition at line 1238 of file ftdi-elan.c.

#define cPIDout   0x1

Definition at line 1236 of file ftdi-elan.c.

#define cPIDsetup   0x0

Definition at line 1235 of file ftdi-elan.c.

#define cU132cmd_status   0x0

Definition at line 1233 of file ftdi-elan.c.

#define cU132flash   0x1

Definition at line 1234 of file ftdi-elan.c.

#define ftdi_read_pcimem (   ftdi,
  member,
  data 
)
Value:
ftdi_elan_read_pcimem(ftdi, \
offsetof(struct ohci_regs, member), 0, data);

Definition at line 2286 of file ftdi-elan.c.

#define ftdi_write_pcimem (   ftdi,
  member,
  data 
)
Value:
ftdi_elan_write_pcimem(ftdi, \
offsetof(struct ohci_regs, member), 0, data);

Definition at line 2288 of file ftdi-elan.c.

#define INT_MODULE_PARM (   n,
  v 
)    static int n = v;module_param(n, int, 0444)

Definition at line 55 of file ftdi-elan.c.

#define kref_to_usb_ftdi (   d)    container_of(d, struct usb_ftdi, kref)

Definition at line 193 of file ftdi-elan.c.

#define OHCI_CONTROL_INIT   OHCI_CTRL_CBSR

Definition at line 2291 of file ftdi-elan.c.

#define OHCI_INTR_INIT
Value:
OHCI_INTR_WDH)

Definition at line 2292 of file ftdi-elan.c.

#define platform_device_to_usb_ftdi (   d)
Value:
platform_dev)

Definition at line 194 of file ftdi-elan.c.

#define RESPOND_BITS   5

Definition at line 119 of file ftdi-elan.c.

#define RESPOND_MASK   (RESPOND_SIZE-1)

Definition at line 121 of file ftdi-elan.c.

#define RESPOND_SIZE   (1<<RESPOND_BITS)

Definition at line 120 of file ftdi-elan.c.

#define USB_FTDI_ELAN_MINOR_BASE   192

Definition at line 106 of file ftdi-elan.c.

#define USB_FTDI_ELAN_PRODUCT_ID   0xd6ea

Definition at line 87 of file ftdi-elan.c.

#define USB_FTDI_ELAN_VENDOR_ID   0x0403

Definition at line 86 of file ftdi-elan.c.

Function Documentation

EXPORT_SYMBOL_GPL ( ftdi_elan_gone_away  )
EXPORT_SYMBOL_GPL ( usb_ftdi_elan_write_pcimem  )
EXPORT_SYMBOL_GPL ( usb_ftdi_elan_read_pcimem  )
EXPORT_SYMBOL_GPL ( usb_ftdi_elan_edset_setup  )
EXPORT_SYMBOL_GPL ( usb_ftdi_elan_edset_input  )
EXPORT_SYMBOL_GPL ( usb_ftdi_elan_edset_empty  )
EXPORT_SYMBOL_GPL ( usb_ftdi_elan_edset_output  )
EXPORT_SYMBOL_GPL ( usb_ftdi_elan_edset_single  )
EXPORT_SYMBOL_GPL ( usb_ftdi_elan_edset_flush  )
void ftdi_elan_gone_away ( struct platform_device pdev)

Definition at line 281 of file ftdi-elan.c.

MODULE_AUTHOR ( "Tony Olech"  )
MODULE_DESCRIPTION ( "FTDI ELAN driver )
MODULE_DEVICE_TABLE ( usb  ,
ftdi_elan_table   
)
module_exit ( ftdi_elan_exit  )
module_init ( ftdi_elan_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( distrust_firmware  ,
bool  ,
 
)
MODULE_PARM_DESC ( distrust_firmware  ,
"true to distrust firmware power/overcurren""t setup  
)
int usb_ftdi_elan_edset_empty ( struct platform_device pdev,
u8  ed_number,
void endp,
struct urb urb,
u8  address,
u8  ep_number,
u8  toggle_bits,
void(*)(void *endp, struct urb *urb, u8 *buf, int len, int toggle_bits, int error_count, int condition_code, int repeat_number, int halted, int skipped, int actual, int non_null)  callback 
)

Definition at line 1662 of file ftdi-elan.c.

int usb_ftdi_elan_edset_flush ( struct platform_device pdev,
u8  ed_number,
void endp 
)

Definition at line 1865 of file ftdi-elan.c.

int usb_ftdi_elan_edset_input ( struct platform_device pdev,
u8  ed_number,
void endp,
struct urb urb,
u8  address,
u8  ep_number,
u8  toggle_bits,
void(*)(void *endp, struct urb *urb, u8 *buf, int len, int toggle_bits, int error_count, int condition_code, int repeat_number, int halted, int skipped, int actual, int non_null)  callback 
)

Definition at line 1605 of file ftdi-elan.c.

int usb_ftdi_elan_edset_output ( struct platform_device pdev,
u8  ed_number,
void endp,
struct urb urb,
u8  address,
u8  ep_number,
u8  toggle_bits,
void(*)(void *endp, struct urb *urb, u8 *buf, int len, int toggle_bits, int error_count, int condition_code, int repeat_number, int halted, int skipped, int actual, int non_null)  callback 
)

Definition at line 1741 of file ftdi-elan.c.

int usb_ftdi_elan_edset_setup ( struct platform_device pdev,
u8  ed_number,
void endp,
struct urb urb,
u8  address,
u8  ep_number,
u8  toggle_bits,
void(*)(void *endp, struct urb *urb, u8 *buf, int len, int toggle_bits, int error_count, int condition_code, int repeat_number, int halted, int skipped, int actual, int non_null)  callback 
)

Definition at line 1540 of file ftdi-elan.c.

int usb_ftdi_elan_edset_single ( struct platform_device pdev,
u8  ed_number,
void endp,
struct urb urb,
u8  address,
u8  ep_number,
u8  toggle_bits,
void(*)(void *endp, struct urb *urb, u8 *buf, int len, int toggle_bits, int error_count, int condition_code, int repeat_number, int halted, int skipped, int actual, int non_null)  callback 
)

Definition at line 1806 of file ftdi-elan.c.

int usb_ftdi_elan_read_pcimem ( struct platform_device pdev,
int  mem_offset,
u8  width,
u32 data 
)

Definition at line 1484 of file ftdi-elan.c.

int usb_ftdi_elan_write_pcimem ( struct platform_device pdev,
int  mem_offset,
u8  width,
u32  data 
)

Definition at line 1346 of file ftdi-elan.c.

Variable Documentation

struct platform_driver u132_platform_driver