Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
alauda.c File Reference
#include <linux/module.h>
#include <linux/slab.h>
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>
#include "usb.h"
#include "transport.h"
#include "protocol.h"
#include "debug.h"
#include "unusual_alauda.h"

Go to the source code of this file.

Data Structures

struct  alauda_media_info
 
struct  alauda_info
 
struct  alauda_card_info
 

Macros

#define ALAUDA_STATUS_ERROR   0x01
 
#define ALAUDA_STATUS_READY   0x40
 
#define ALAUDA_GET_XD_MEDIA_STATUS   0x08
 
#define ALAUDA_GET_SM_MEDIA_STATUS   0x98
 
#define ALAUDA_ACK_XD_MEDIA_CHANGE   0x0a
 
#define ALAUDA_ACK_SM_MEDIA_CHANGE   0x9a
 
#define ALAUDA_GET_XD_MEDIA_SIG   0x86
 
#define ALAUDA_GET_SM_MEDIA_SIG   0x96
 
#define ALAUDA_BULK_CMD   0x40
 
#define ALAUDA_BULK_GET_REDU_DATA   0x85
 
#define ALAUDA_BULK_READ_BLOCK   0x94
 
#define ALAUDA_BULK_ERASE_BLOCK   0xa3
 
#define ALAUDA_BULK_WRITE_BLOCK   0xb4
 
#define ALAUDA_BULK_GET_STATUS2   0xb7
 
#define ALAUDA_BULK_RESET_MEDIA   0xe0
 
#define ALAUDA_PORT_XD   0x00
 
#define ALAUDA_PORT_SM   0x01
 
#define UNDEF   0xffff
 
#define SPARE   0xfffe
 
#define UNUSABLE   0xfffd
 
#define short_pack(lsb, msb)   ( ((u16)(lsb)) | ( ((u16)(msb))<<8 ) )
 
#define LSB_of(s)   ((s)&0xFF)
 
#define MSB_of(s)   ((s)>>8)
 
#define MEDIA_PORT(us)   us->srb->device->lun
 
#define MEDIA_INFO(us)   ((struct alauda_info *)us->extra)->port[MEDIA_PORT(us)]
 
#define PBA_LO(pba)   ((pba & 0xF) << 5)
 
#define PBA_HI(pba)   (pba >> 3)
 
#define PBA_ZONE(pba)   (pba >> 11)
 
#define UNUSUAL_DEV(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax, vendorName, productName, useProtocol, useTransport, initFunction, flags)
 
#define UNUSUAL_DEV(idVendor, idProduct, bcdDeviceMin, bcdDeviceMax, vendor_name, product_name, use_protocol, use_transport, init_function, Flags)
 

Functions

 MODULE_DESCRIPTION ("Driver for Alauda-based card readers")
 
 MODULE_AUTHOR ("Daniel Drake <[email protected]>")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_DEVICE_TABLE (usb, alauda_usb_ids)
 
 module_usb_driver (alauda_driver)
 

Macro Definition Documentation

#define ALAUDA_ACK_SM_MEDIA_CHANGE   0x9a

Definition at line 62 of file alauda.c.

#define ALAUDA_ACK_XD_MEDIA_CHANGE   0x0a

Definition at line 61 of file alauda.c.

#define ALAUDA_BULK_CMD   0x40

Definition at line 69 of file alauda.c.

#define ALAUDA_BULK_ERASE_BLOCK   0xa3

Definition at line 76 of file alauda.c.

#define ALAUDA_BULK_GET_REDU_DATA   0x85

Definition at line 74 of file alauda.c.

#define ALAUDA_BULK_GET_STATUS2   0xb7

Definition at line 78 of file alauda.c.

#define ALAUDA_BULK_READ_BLOCK   0x94

Definition at line 75 of file alauda.c.

#define ALAUDA_BULK_RESET_MEDIA   0xe0

Definition at line 79 of file alauda.c.

#define ALAUDA_BULK_WRITE_BLOCK   0xb4

Definition at line 77 of file alauda.c.

#define ALAUDA_GET_SM_MEDIA_SIG   0x96

Definition at line 64 of file alauda.c.

#define ALAUDA_GET_SM_MEDIA_STATUS   0x98

Definition at line 60 of file alauda.c.

#define ALAUDA_GET_XD_MEDIA_SIG   0x86

Definition at line 63 of file alauda.c.

#define ALAUDA_GET_XD_MEDIA_STATUS   0x08

Definition at line 59 of file alauda.c.

#define ALAUDA_PORT_SM   0x01

Definition at line 85 of file alauda.c.

#define ALAUDA_PORT_XD   0x00

Definition at line 84 of file alauda.c.

#define ALAUDA_STATUS_ERROR   0x01

Definition at line 53 of file alauda.c.

#define ALAUDA_STATUS_READY   0x40

Definition at line 54 of file alauda.c.

#define LSB_of (   s)    ((s)&0xFF)

Definition at line 120 of file alauda.c.

#define MEDIA_INFO (   us)    ((struct alauda_info *)us->extra)->port[MEDIA_PORT(us)]

Definition at line 124 of file alauda.c.

#define MEDIA_PORT (   us)    us->srb->device->lun

Definition at line 123 of file alauda.c.

#define MSB_of (   s)    ((s)>>8)

Definition at line 121 of file alauda.c.

#define PBA_HI (   pba)    (pba >> 3)

Definition at line 127 of file alauda.c.

#define PBA_LO (   pba)    ((pba & 0xF) << 5)

Definition at line 126 of file alauda.c.

#define PBA_ZONE (   pba)    (pba >> 11)

Definition at line 128 of file alauda.c.

#define short_pack (   lsb,
  msb 
)    ( ((u16)(lsb)) | ( ((u16)(msb))<<8 ) )

Definition at line 119 of file alauda.c.

#define SPARE   0xfffe

Definition at line 91 of file alauda.c.

#define UNDEF   0xffff

Definition at line 90 of file alauda.c.

#define UNUSABLE   0xfffd

Definition at line 92 of file alauda.c.

#define UNUSUAL_DEV (   id_vendor,
  id_product,
  bcdDeviceMin,
  bcdDeviceMax,
  vendorName,
  productName,
  useProtocol,
  useTransport,
  initFunction,
  flags 
)
Value:
{ USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
.driver_info = (flags) }

Definition at line 153 of file alauda.c.

#define UNUSUAL_DEV (   idVendor,
  idProduct,
  bcdDeviceMin,
  bcdDeviceMax,
  vendor_name,
  product_name,
  use_protocol,
  use_transport,
  init_function,
  Flags 
)
Value:
{ \
.vendorName = vendor_name, \
.productName = product_name, \
.useProtocol = use_protocol, \
.useTransport = use_transport, \
.initFunction = init_function, \
}

Definition at line 153 of file alauda.c.

Function Documentation

MODULE_AUTHOR ( "Daniel Drake <[email protected]>"  )
MODULE_DESCRIPTION ( "Driver for Alauda-based card readers"  )
MODULE_DEVICE_TABLE ( usb  ,
alauda_usb_ids   
)
MODULE_LICENSE ( "GPL"  )
module_usb_driver ( alauda_driver  )