Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
vub300.c File Reference
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/kref.h>
#include <linux/uaccess.h>
#include <linux/usb.h>
#include <linux/mutex.h>
#include <linux/mmc/host.h>
#include <linux/mmc/card.h>
#include <linux/mmc/sdio_func.h>
#include <linux/mmc/sdio_ids.h>
#include <linux/workqueue.h>
#include <linux/ctype.h>
#include <linux/firmware.h>
#include <linux/scatterlist.h>

Go to the source code of this file.

Data Structures

struct  host_controller_info
 
struct  sd_command_header
 
struct  sd_irqpoll_header
 
struct  sd_common_header
 
struct  sd_response_header
 
struct  sd_status_header
 
struct  sd_error_header
 
struct  sd_interrupt_header
 
struct  offload_registers_access
 
struct  sd_offloaded_interrupt
 
struct  sd_register_header
 
struct  sd_offloaded_piggyback
 
union  sd_response
 
union  sd_command
 
struct  sdio_register
 
struct  vub300_mmc_host
 
struct  vub300_mmc_host::offload_interrupt_function_register
 

Macros

#define FIRMWARE_BLOCK_BOUNDARY   1024
 
#define INTERRUPT_REGISTER_ACCESSES   15
 
#define PIGGYBACK_REGISTER_ACCESSES   14
 
#define RESPONSE_INTERRUPT   0x01
 
#define RESPONSE_ERROR   0x02
 
#define RESPONSE_STATUS   0x03
 
#define RESPONSE_IRQ_DISABLED   0x05
 
#define RESPONSE_IRQ_ENABLED   0x06
 
#define RESPONSE_PIGGYBACKED   0x07
 
#define RESPONSE_NO_INTERRUPT   0x08
 
#define RESPONSE_PIG_DISABLED   0x09
 
#define RESPONSE_PIG_ENABLED   0x0A
 
#define SD_ERROR_1BIT_TIMEOUT   0x01
 
#define SD_ERROR_4BIT_TIMEOUT   0x02
 
#define SD_ERROR_1BIT_CRC_WRONG   0x03
 
#define SD_ERROR_4BIT_CRC_WRONG   0x04
 
#define SD_ERROR_1BIT_CRC_ERROR   0x05
 
#define SD_ERROR_4BIT_CRC_ERROR   0x06
 
#define SD_ERROR_NO_CMD_ENDBIT   0x07
 
#define SD_ERROR_NO_1BIT_DATEND   0x08
 
#define SD_ERROR_NO_4BIT_DATEND   0x09
 
#define SD_ERROR_1BIT_UNEXPECTED_TIMEOUT   0x0A
 
#define SD_ERROR_4BIT_UNEXPECTED_TIMEOUT   0x0B
 
#define SD_ERROR_ILLEGAL_COMMAND   0x0C
 
#define SD_ERROR_NO_DEVICE   0x0D
 
#define SD_ERROR_TRANSFER_LENGTH   0x0E
 
#define SD_ERROR_1BIT_DATA_TIMEOUT   0x0F
 
#define SD_ERROR_4BIT_DATA_TIMEOUT   0x10
 
#define SD_ERROR_ILLEGAL_STATE   0x11
 
#define SD_ERROR_UNKNOWN_ERROR   0x12
 
#define SD_ERROR_RESERVED_ERROR   0x13
 
#define SD_ERROR_INVALID_FUNCTION   0x14
 
#define SD_ERROR_OUT_OF_RANGE   0x15
 
#define SD_ERROR_STAT_CMD   0x16
 
#define SD_ERROR_STAT_DATA   0x17
 
#define SD_ERROR_STAT_CMD_TIMEOUT   0x18
 
#define SD_ERROR_SDCRDY_STUCK   0x19
 
#define SD_ERROR_UNHANDLED   0x1A
 
#define SD_ERROR_OVERRUN   0x1B
 
#define SD_ERROR_PIO_TIMEOUT   0x1C
 
#define FUN(c)   (0x000007 & (c->arg>>28))
 
#define REG(c)   (0x01FFFF & (c->arg>>9))
 
#define ELAN_VENDOR_ID   0x2201
 
#define VUB300_VENDOR_ID   0x0424
 
#define VUB300_PRODUCT_ID   0x012C
 
#define MAXREGBITS   4
 
#define MAXREGS   (1<<MAXREGBITS)
 
#define MAXREGMASK   (MAXREGS-1)
 
#define kref_to_vub300_mmc_host(d)   container_of(d, struct vub300_mmc_host, kref)
 
#define SET_TRANSFER_PSEUDOCODE   21
 
#define SET_INTERRUPT_PSEUDOCODE   20
 
#define SET_FAILURE_MODE   18
 
#define SET_ROM_WAIT_STATES   16
 
#define SET_IRQ_ENABLE   13
 
#define SET_CLOCK_SPEED   11
 
#define SET_FUNCTION_BLOCK_SIZE   9
 
#define SET_SD_DATA_MODE   6
 
#define SET_SD_POWER   4
 
#define ENTER_DFU_MODE   3
 
#define GET_HC_INF0   1
 
#define GET_SYSTEM_PORT_STATUS   0
 
#define vub300_suspend   NULL
 
#define vub300_resume   NULL
 

Enumerations

enum  SD_RESPONSE_TYPE {
  SDRT_UNSPECIFIED = 0, SDRT_NONE, SDRT_1, SDRT_1B,
  SDRT_2, SDRT_3, SDRT_4, SDRT_5,
  SDRT_5B, SDRT_6, SDRT_7
}
 

Functions

 module_param (limit_speed_to_24_MHz, bool, 0644)
 
 MODULE_PARM_DESC (limit_speed_to_24_MHz,"Limit Max SDIO Clock Speed to 24 MHz")
 
 module_param (pad_input_to_usb_pkt, bool, 0644)
 
 MODULE_PARM_DESC (pad_input_to_usb_pkt,"Pad USB data input transfers to whole USB Packet")
 
 module_param (disable_offload_processing, bool, 0644)
 
 MODULE_PARM_DESC (disable_offload_processing,"Disable Offload Processing")
 
 module_param (force_1_bit_data_xfers, bool, 0644)
 
 MODULE_PARM_DESC (force_1_bit_data_xfers,"Force SDIO Data Transfers to 1-bit Mode")
 
 module_param (force_polling_for_irqs, bool, 0644)
 
 MODULE_PARM_DESC (force_polling_for_irqs,"Force Polling for SDIO interrupts")
 
 module_param (firmware_irqpoll_timeout, int, 0644)
 
 MODULE_PARM_DESC (firmware_irqpoll_timeout,"VUB300 firmware irqpoll timeout")
 
 module_param (force_max_req_size, int, 0644)
 
 MODULE_PARM_DESC (force_max_req_size,"set max request size in kBytes")
 
 module_param (firmware_rom_wait_states, int, 0644)
 
 MODULE_PARM_DESC (firmware_rom_wait_states,"ROM wait states byte=RRRIIEEE (Reserved Internal External)")
 
 MODULE_DEVICE_TABLE (usb, vub300_table)
 
void vub300_init_card (struct mmc_host *mmc, struct mmc_card *card)
 
 module_init (vub300_init)
 
 module_exit (vub300_exit)
 
 MODULE_AUTHOR ("Tony Olech <[email protected]>")
 
 MODULE_DESCRIPTION ("VUB300 USB to SD/MMC/SDIO adapter driver")
 
 MODULE_LICENSE ("GPL")
 

Variables

struct host_controller_info __packed
 

Macro Definition Documentation

#define ELAN_VENDOR_ID   0x2201

Definition at line 266 of file vub300.c.

#define ENTER_DFU_MODE   3

Definition at line 368 of file vub300.c.

#define FIRMWARE_BLOCK_BOUNDARY   1024

Definition at line 62 of file vub300.c.

#define FUN (   c)    (0x000007 & (c->arg>>28))

Definition at line 223 of file vub300.c.

#define GET_HC_INF0   1

Definition at line 369 of file vub300.c.

#define GET_SYSTEM_PORT_STATUS   0

Definition at line 370 of file vub300.c.

#define INTERRUPT_REGISTER_ACCESSES   15

Definition at line 133 of file vub300.c.

#define kref_to_vub300_mmc_host (   d)    container_of(d, struct vub300_mmc_host, kref)

Definition at line 358 of file vub300.c.

#define MAXREGBITS   4

Definition at line 328 of file vub300.c.

#define MAXREGMASK   (MAXREGS-1)

Definition at line 330 of file vub300.c.

#define MAXREGS   (1<<MAXREGBITS)

Definition at line 329 of file vub300.c.

#define PIGGYBACK_REGISTER_ACCESSES   14

Definition at line 150 of file vub300.c.

#define REG (   c)    (0x01FFFF & (c->arg>>9))

Definition at line 224 of file vub300.c.

#define RESPONSE_ERROR   0x02

Definition at line 186 of file vub300.c.

#define RESPONSE_INTERRUPT   0x01

Definition at line 185 of file vub300.c.

#define RESPONSE_IRQ_DISABLED   0x05

Definition at line 188 of file vub300.c.

#define RESPONSE_IRQ_ENABLED   0x06

Definition at line 189 of file vub300.c.

#define RESPONSE_NO_INTERRUPT   0x08

Definition at line 191 of file vub300.c.

#define RESPONSE_PIG_DISABLED   0x09

Definition at line 192 of file vub300.c.

#define RESPONSE_PIG_ENABLED   0x0A

Definition at line 193 of file vub300.c.

#define RESPONSE_PIGGYBACKED   0x07

Definition at line 190 of file vub300.c.

#define RESPONSE_STATUS   0x03

Definition at line 187 of file vub300.c.

#define SD_ERROR_1BIT_CRC_ERROR   0x05

Definition at line 198 of file vub300.c.

#define SD_ERROR_1BIT_CRC_WRONG   0x03

Definition at line 196 of file vub300.c.

#define SD_ERROR_1BIT_DATA_TIMEOUT   0x0F

Definition at line 208 of file vub300.c.

#define SD_ERROR_1BIT_TIMEOUT   0x01

Definition at line 194 of file vub300.c.

#define SD_ERROR_1BIT_UNEXPECTED_TIMEOUT   0x0A

Definition at line 203 of file vub300.c.

#define SD_ERROR_4BIT_CRC_ERROR   0x06

Definition at line 199 of file vub300.c.

#define SD_ERROR_4BIT_CRC_WRONG   0x04

Definition at line 197 of file vub300.c.

#define SD_ERROR_4BIT_DATA_TIMEOUT   0x10

Definition at line 209 of file vub300.c.

#define SD_ERROR_4BIT_TIMEOUT   0x02

Definition at line 195 of file vub300.c.

#define SD_ERROR_4BIT_UNEXPECTED_TIMEOUT   0x0B

Definition at line 204 of file vub300.c.

#define SD_ERROR_ILLEGAL_COMMAND   0x0C

Definition at line 205 of file vub300.c.

#define SD_ERROR_ILLEGAL_STATE   0x11

Definition at line 210 of file vub300.c.

#define SD_ERROR_INVALID_FUNCTION   0x14

Definition at line 213 of file vub300.c.

#define SD_ERROR_NO_1BIT_DATEND   0x08

Definition at line 201 of file vub300.c.

#define SD_ERROR_NO_4BIT_DATEND   0x09

Definition at line 202 of file vub300.c.

#define SD_ERROR_NO_CMD_ENDBIT   0x07

Definition at line 200 of file vub300.c.

#define SD_ERROR_NO_DEVICE   0x0D

Definition at line 206 of file vub300.c.

#define SD_ERROR_OUT_OF_RANGE   0x15

Definition at line 214 of file vub300.c.

#define SD_ERROR_OVERRUN   0x1B

Definition at line 220 of file vub300.c.

#define SD_ERROR_PIO_TIMEOUT   0x1C

Definition at line 221 of file vub300.c.

#define SD_ERROR_RESERVED_ERROR   0x13

Definition at line 212 of file vub300.c.

#define SD_ERROR_SDCRDY_STUCK   0x19

Definition at line 218 of file vub300.c.

#define SD_ERROR_STAT_CMD   0x16

Definition at line 215 of file vub300.c.

#define SD_ERROR_STAT_CMD_TIMEOUT   0x18

Definition at line 217 of file vub300.c.

#define SD_ERROR_STAT_DATA   0x17

Definition at line 216 of file vub300.c.

#define SD_ERROR_TRANSFER_LENGTH   0x0E

Definition at line 207 of file vub300.c.

#define SD_ERROR_UNHANDLED   0x1A

Definition at line 219 of file vub300.c.

#define SD_ERROR_UNKNOWN_ERROR   0x12

Definition at line 211 of file vub300.c.

#define SET_CLOCK_SPEED   11

Definition at line 364 of file vub300.c.

#define SET_FAILURE_MODE   18

Definition at line 361 of file vub300.c.

#define SET_FUNCTION_BLOCK_SIZE   9

Definition at line 365 of file vub300.c.

#define SET_INTERRUPT_PSEUDOCODE   20

Definition at line 360 of file vub300.c.

#define SET_IRQ_ENABLE   13

Definition at line 363 of file vub300.c.

#define SET_ROM_WAIT_STATES   16

Definition at line 362 of file vub300.c.

#define SET_SD_DATA_MODE   6

Definition at line 366 of file vub300.c.

#define SET_SD_POWER   4

Definition at line 367 of file vub300.c.

#define SET_TRANSFER_PSEUDOCODE   21

Definition at line 359 of file vub300.c.

#define VUB300_PRODUCT_ID   0x012C

Definition at line 268 of file vub300.c.

#define vub300_resume   NULL

Definition at line 2417 of file vub300.c.

#define vub300_suspend   NULL

Definition at line 2416 of file vub300.c.

#define VUB300_VENDOR_ID   0x0424

Definition at line 267 of file vub300.c.

Enumeration Type Documentation

Enumerator:
SDRT_UNSPECIFIED 
SDRT_NONE 
SDRT_1 
SDRT_1B 
SDRT_2 
SDRT_3 
SDRT_4 
SDRT_5 
SDRT_5B 
SDRT_6 
SDRT_7 

Definition at line 171 of file vub300.c.

Function Documentation

MODULE_AUTHOR ( "Tony Olech <[email protected]>"  )
MODULE_DESCRIPTION ( "VUB300 USB to SD/MMC/SDIO adapter driver )
MODULE_DEVICE_TABLE ( usb  ,
vub300_table   
)
module_exit ( vub300_exit  )
module_init ( vub300_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( limit_speed_to_24_MHz  ,
bool  ,
0644   
)
module_param ( pad_input_to_usb_pkt  ,
bool  ,
0644   
)
module_param ( disable_offload_processing  ,
bool  ,
0644   
)
module_param ( force_1_bit_data_xfers  ,
bool  ,
0644   
)
module_param ( force_polling_for_irqs  ,
bool  ,
0644   
)
module_param ( firmware_irqpoll_timeout  ,
int  ,
0644   
)
module_param ( force_max_req_size  ,
int  ,
0644   
)
module_param ( firmware_rom_wait_states  ,
int  ,
0644   
)
MODULE_PARM_DESC ( limit_speed_to_24_MHz  ,
"Limit Max SDIO Clock Speed to 24 MHz  
)
MODULE_PARM_DESC ( pad_input_to_usb_pkt  ,
"Pad USB data input transfers to whole USB Packet  
)
MODULE_PARM_DESC ( disable_offload_processing  ,
"Disable Offload Processing"   
)
MODULE_PARM_DESC ( force_1_bit_data_xfers  ,
"Force SDIO Data Transfers to 1-bit Mode  
)
MODULE_PARM_DESC ( force_polling_for_irqs  ,
"Force Polling for SDIO interrupts"   
)
MODULE_PARM_DESC ( firmware_irqpoll_timeout  ,
"VUB300 firmware irqpoll timeout  
)
MODULE_PARM_DESC ( force_max_req_size  ,
"set max request size in kBytes"   
)
MODULE_PARM_DESC ( firmware_rom_wait_states  )
void vub300_init_card ( struct mmc_host mmc,
struct mmc_card card 
)

Definition at line 2082 of file vub300.c.

Variable Documentation