Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
sx8.c File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/blkdev.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/compiler.h>
#include <linux/workqueue.h>
#include <linux/bitops.h>
#include <linux/delay.h>
#include <linux/time.h>
#include <linux/hdreg.h>
#include <linux/dma-mapping.h>
#include <linux/completion.h>
#include <linux/scatterlist.h>
#include <asm/io.h>
#include <asm/uaccess.h>

Go to the source code of this file.

Data Structures

struct  carm_port
 
struct  carm_request
 
struct  carm_host
 
struct  carm_response
 
struct  carm_msg_sg
 
struct  carm_msg_rw
 
struct  carm_msg_allocbuf
 
struct  carm_msg_ioctl
 
struct  carm_msg_sync_time
 
struct  carm_msg_get_fw_ver
 
struct  carm_fw_ver
 
struct  carm_array_info
 

Macros

#define DRV_NAME   "sx8"
 
#define DRV_VERSION   "1.0"
 
#define PFX   DRV_NAME ": "
 
#define NEXT_RESP(idx)   ((idx + 1) % RMSG_Q_LEN)
 
#define TAG_ENCODE(tag)   (((tag) << 16) | 0xf)
 
#define TAG_DECODE(tag)   (((tag) >> 16) & 0x1f)
 
#define TAG_VALID(tag)   ((((tag) & 0xf) == 0xf) && (TAG_DECODE(tag) < 32))
 
#define DPRINTK(fmt, args...)
 
#define VPRINTK(fmt, args...)
 
#define assert(expr)
 

Typedefs

typedef unsigned int(* carm_sspc_t )(struct carm_host *, unsigned int, void *)
 

Enumerations

enum  {
  CARM_MAX_PORTS = 8, CARM_SHM_SIZE = (4096 << 7), CARM_MINORS_PER_MAJOR = 256 / CARM_MAX_PORTS, CARM_MAX_WAIT_Q = CARM_MAX_PORTS + 1,
  CARM_MAX_REQ = 64, CARM_MSG_LOW_WATER = (CARM_MAX_REQ / 4), CARM_MAX_REQ_SG = 32, CARM_MAX_HOST_SG = 600,
  CARM_SG_LOW_WATER = (CARM_MAX_HOST_SG / 4), CARM_IHQP = 0x1c, CARM_INT_STAT = 0x10, CARM_INT_MASK = 0x14,
  CARM_HMUC = 0x18, RBUF_ADDR_LO = 0x20, RBUF_ADDR_HI = 0x24, RBUF_BYTE_SZ = 0x28,
  CARM_RESP_IDX = 0x2c, CARM_CMS0 = 0x30, CARM_LMUC = 0x48, CARM_HMPHA = 0x6c,
  CARM_INITC = 0xb5, INT_RESERVED = 0xfffffff0, INT_WATCHDOG = (1 << 3), INT_Q_OVERFLOW = (1 << 2),
  INT_Q_AVAILABLE = (1 << 1), INT_RESPONSE = (1 << 0), INT_ACK_MASK = INT_WATCHDOG | INT_Q_OVERFLOW, INT_DEF_MASK,
  CARM_HAVE_RESP = 0x01, CARM_MSG_READ = 1, CARM_MSG_WRITE = 2, CARM_MSG_VERIFY = 3,
  CARM_MSG_GET_CAPACITY = 4, CARM_MSG_FLUSH = 5, CARM_MSG_IOCTL = 6, CARM_MSG_ARRAY = 8,
  CARM_MSG_MISC = 9, CARM_CME = (1 << 2), CARM_RME = (1 << 1), CARM_WZBC = (1 << 0),
  CARM_RMI = (1 << 0), CARM_Q_FULL = (1 << 3), CARM_MSG_SIZE = 288, CARM_Q_LEN = 48,
  CARM_IOC_SCAN_CHAN = 5, CARM_IOC_GET_TCQ = 13, CARM_IOC_SET_TCQ = 14, IOC_SCAN_CHAN_NODEV = 0x1f,
  IOC_SCAN_CHAN_OFFSET = 0x40, CARM_ARRAY_INFO = 0, ARRAY_NO_EXIST = (1 << 31), RMSG_SZ = 8,
  RMSG_Q_LEN = 48, RMSG_OK = 1, RBUF_LEN = RMSG_SZ * RMSG_Q_LEN, PDC_SHM_SIZE = (4096 << 7),
  MISC_GET_FW_VER = 2, MISC_ALLOC_MEM = 3, MISC_SET_TIME = 5, FW_VER_4PORT = (1 << 2),
  FW_VER_NON_RAID = (1 << 1), FW_VER_ZCR = (1 << 0), FL_NON_RAID = FW_VER_NON_RAID, FL_4PORT = FW_VER_4PORT,
  FL_FW_VER_MASK = (FW_VER_NON_RAID | FW_VER_4PORT), FL_DAC = (1 << 16), FL_DYN_MAJOR = (1 << 17)
}
 
enum  { CARM_SG_BOUNDARY = 0xffffUL }
 
enum  scatter_gather_types { SGT_32BIT = 0, SGT_64BIT = 1 }
 
enum  host_states {
  HST_INVALID, HST_ALLOC_BUF, HST_ERROR, HST_PORT_SCAN,
  HST_DEV_SCAN_START, HST_DEV_SCAN, HST_DEV_ACTIVATE, HST_PROBE_FINISHED,
  HST_PROBE_START, HST_SYNC_TIME, HST_GET_FW_VER
}
 

Functions

 MODULE_AUTHOR ("Jeff Garzik")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_DESCRIPTION ("Promise SATA SX8 block driver")
 
 MODULE_VERSION (DRV_VERSION)
 
 module_param (max_queue, int, 0444)
 
 MODULE_PARM_DESC (max_queue,"Maximum number of queued commands. (min==1, max==30, safe==1)")
 
struct carm_response __attribute__ ((packed))
 
 MODULE_DEVICE_TABLE (pci, carm_pci_tbl)
 
 module_init (carm_init)
 
 module_exit (carm_exit)
 

Variables

__le32 ret_handle
 
__le32 status
 
__le32 start
 
__le32 len
 
u8 type
 
u8 id
 
u8 sg_count
 
u8 sg_type
 
__le32 handle
 
__le32 lba
 
__le16 lba_count
 
__le16 lba_high
 
struct carm_msg_sg sg [32]
 
u8 subtype
 
u8 n_sg
 
__le32 addr
 
__le32 evt_pool
 
__le32 n_evt
 
__le32 rbuf_pool
 
__le32 n_rbuf
 
__le32 msg_pool
 
__le32 n_msg
 
u8 array_id
 
u8 reserved1
 
__le32 data_addr
 
u32 reserved2
 
__le32 timestamp
 
__le32 version
 
u8 features
 
__le32 size
 
__le16 size_hi
 
__le16 stripe_size
 
__le32 mode
 
__le16 stripe_blk_sz
 
__le16 cyl
 
__le16 head
 
__le16 sect
 
char name [40]
 
__le32 array_status
 

Macro Definition Documentation

#define assert (   expr)
Value:
if(unlikely(!(expr))) { \
printk(KERN_ERR "Assertion failed! %s,%s,%s,line=%d\n", \
#expr, __FILE__, __func__, __LINE__); \
}

Definition at line 96 of file sx8.c.

#define DPRINTK (   fmt,
  args... 
)

Definition at line 89 of file sx8.c.

#define DRV_NAME   "sx8"

Definition at line 43 of file sx8.c.

#define DRV_VERSION   "1.0"

Definition at line 44 of file sx8.c.

#define NEXT_RESP (   idx)    ((idx + 1) % RMSG_Q_LEN)

Definition at line 73 of file sx8.c.

#define PFX   DRV_NAME ": "

Definition at line 45 of file sx8.c.

#define TAG_DECODE (   tag)    (((tag) >> 16) & 0x1f)

Definition at line 77 of file sx8.c.

#define TAG_ENCODE (   tag)    (((tag) << 16) | 0xf)

Definition at line 76 of file sx8.c.

#define TAG_VALID (   tag)    ((((tag) & 0xf) == 0xf) && (TAG_DECODE(tag) < 32))

Definition at line 78 of file sx8.c.

#define VPRINTK (   fmt,
  args... 
)

Definition at line 90 of file sx8.c.

Typedef Documentation

typedef unsigned int(* carm_sspc_t)(struct carm_host *, unsigned int, void *)

Definition at line 636 of file sx8.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
CARM_MAX_PORTS 
CARM_SHM_SIZE 
CARM_MINORS_PER_MAJOR 
CARM_MAX_WAIT_Q 
CARM_MAX_REQ 
CARM_MSG_LOW_WATER 
CARM_MAX_REQ_SG 
CARM_MAX_HOST_SG 
CARM_SG_LOW_WATER 
CARM_IHQP 
CARM_INT_STAT 
CARM_INT_MASK 
CARM_HMUC 
RBUF_ADDR_LO 
RBUF_ADDR_HI 
RBUF_BYTE_SZ 
CARM_RESP_IDX 
CARM_CMS0 
CARM_LMUC 
CARM_HMPHA 
CARM_INITC 
INT_RESERVED 
INT_WATCHDOG 
INT_Q_OVERFLOW 
INT_Q_AVAILABLE 
INT_RESPONSE 
INT_ACK_MASK 
INT_DEF_MASK 
CARM_HAVE_RESP 
CARM_MSG_READ 
CARM_MSG_WRITE 
CARM_MSG_VERIFY 
CARM_MSG_GET_CAPACITY 
CARM_MSG_FLUSH 
CARM_MSG_IOCTL 
CARM_MSG_ARRAY 
CARM_MSG_MISC 
CARM_CME 
CARM_RME 
CARM_WZBC 
CARM_RMI 
CARM_Q_FULL 
CARM_MSG_SIZE 
CARM_Q_LEN 
CARM_IOC_SCAN_CHAN 
CARM_IOC_GET_TCQ 
CARM_IOC_SET_TCQ 
IOC_SCAN_CHAN_NODEV 
IOC_SCAN_CHAN_OFFSET 
CARM_ARRAY_INFO 
ARRAY_NO_EXIST 
RMSG_SZ 
RMSG_Q_LEN 
RMSG_OK 
RBUF_LEN 
PDC_SHM_SIZE 
MISC_GET_FW_VER 
MISC_ALLOC_MEM 
MISC_SET_TIME 
FW_VER_4PORT 
FW_VER_NON_RAID 
FW_VER_ZCR 
FL_NON_RAID 
FL_4PORT 
FL_FW_VER_MASK 
FL_DAC 
FL_DYN_MAJOR 

Definition at line 106 of file sx8.c.

anonymous enum
Enumerator:
CARM_SG_BOUNDARY 

Definition at line 204 of file sx8.c.

Enumerator:
HST_INVALID 
HST_ALLOC_BUF 
HST_ERROR 
HST_PORT_SCAN 
HST_DEV_SCAN_START 
HST_DEV_SCAN 
HST_DEV_ACTIVATE 
HST_PROBE_FINISHED 
HST_PROBE_START 
HST_SYNC_TIME 
HST_GET_FW_VER 

Definition at line 213 of file sx8.c.

Enumerator:
SGT_32BIT 
SGT_64BIT 

Definition at line 208 of file sx8.c.

Function Documentation

struct carm_response __attribute__ ( (packed)  )
read

Definition at line 171 of file esd_usb2.c.

MODULE_AUTHOR ( "Jeff Garzik"  )
MODULE_DESCRIPTION ( "Promise SATA SX8 block driver )
MODULE_DEVICE_TABLE ( pci  ,
carm_pci_tbl   
)
module_exit ( carm_exit  )
module_init ( carm_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( max_queue  ,
int  ,
0444   
)
MODULE_PARM_DESC ( max_queue  ,
"Maximum number of queued commands. (min==1, max==30, safe==1)"   
)
MODULE_VERSION ( DRV_VERSION  )

Variable Documentation

__le32 addr

Definition at line 352 of file sx8.c.

u8 array_id

Definition at line 359 of file sx8.c.

__le32 array_status

Definition at line 426 of file sx8.c.

__u16 cyl

Definition at line 417 of file sx8.c.

__le32 data_addr

Definition at line 362 of file sx8.c.

__le32 evt_pool

Definition at line 354 of file sx8.c.

Definition at line 383 of file sx8.c.

Definition at line 334 of file sx8.c.

Definition at line 418 of file sx8.c.

u8 id

Definition at line 331 of file sx8.c.

u64 lba

Definition at line 335 of file sx8.c.

__le16 lba_count

Definition at line 336 of file sx8.c.

__le16 lba_high

Definition at line 337 of file sx8.c.

__le32 len

Definition at line 319 of file sx8.c.

__le32 mode

Definition at line 412 of file sx8.c.

__le32 msg_pool

Definition at line 358 of file sx8.c.

__le32 n_evt

Definition at line 355 of file sx8.c.

__le32 n_msg

Definition at line 359 of file sx8.c.

__le32 n_rbuf

Definition at line 357 of file sx8.c.

u8 n_sg

Definition at line 349 of file sx8.c.

char name[40]

Definition at line 424 of file sx8.c.

__le32 rbuf_pool

Definition at line 356 of file sx8.c.

__le16 reserved1

Definition at line 360 of file sx8.c.

u8 reserved2

Definition at line 363 of file sx8.c.

__le32 ret_handle

Definition at line 313 of file sx8.c.

Definition at line 420 of file sx8.c.

Definition at line 338 of file sx8.c.

u8 sg_count

Definition at line 332 of file sx8.c.

u8 sg_type

Definition at line 333 of file sx8.c.

__le32 size

Definition at line 407 of file sx8.c.

__le16 size_hi

Definition at line 409 of file sx8.c.

__le32 start

Definition at line 318 of file sx8.c.

Definition at line 314 of file sx8.c.

__le16 stripe_blk_sz

Definition at line 414 of file sx8.c.

__le16 stripe_size

Definition at line 410 of file sx8.c.

u8 subtype

Definition at line 348 of file sx8.c.

Definition at line 371 of file sx8.c.

Definition at line 330 of file sx8.c.

__le32 version

Definition at line 382 of file sx8.c.