Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
rtsx.h File Reference
#include <linux/io.h>
#include <linux/bitops.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/pci.h>
#include <linux/mutex.h>
#include <linux/cdrom.h>
#include <linux/workqueue.h>
#include <linux/timer.h>
#include <linux/time.h>
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_devinfo.h>
#include <scsi/scsi_eh.h>
#include <scsi/scsi_host.h>
#include "debug.h"
#include "trace.h"
#include "general.h"

Go to the source code of this file.

Data Structures

struct  rtsx_dev
 

Macros

#define CR_DRIVER_NAME   "rts_pstor"
 
#define pci_get_bus_and_slot(bus, devfn)   pci_get_domain_bus_and_slot(0, (bus), (devfn))
 
#define rtsx_writel(chip, reg, value)   iowrite32(value, (chip)->rtsx->remap_addr + reg)
 
#define rtsx_readl(chip, reg)   ioread32((chip)->rtsx->remap_addr + reg)
 
#define rtsx_writew(chip, reg, value)   iowrite16(value, (chip)->rtsx->remap_addr + reg)
 
#define rtsx_readw(chip, reg)   ioread16((chip)->rtsx->remap_addr + reg)
 
#define rtsx_writeb(chip, reg, value)   iowrite8(value, (chip)->rtsx->remap_addr + reg)
 
#define rtsx_readb(chip, reg)   ioread8((chip)->rtsx->remap_addr + reg)
 
#define rtsx_read_config_byte(chip, where, val)   pci_read_config_byte((chip)->rtsx->pci, where, val)
 
#define rtsx_write_config_byte(chip, where, val)   pci_write_config_byte((chip)->rtsx->pci, where, val)
 
#define wait_timeout_x(task_state, msecs)
 
#define wait_timeout(msecs)   wait_timeout_x(TASK_INTERRUPTIBLE, (msecs))
 
#define STATE_TRANS_NONE   0
 
#define STATE_TRANS_CMD   1
 
#define STATE_TRANS_BUF   2
 
#define STATE_TRANS_SG   3
 
#define TRANS_NOT_READY   0
 
#define TRANS_RESULT_OK   1
 
#define TRANS_RESULT_FAIL   2
 
#define SCSI_LUN(srb)   ((srb)->device->lun)
 
#define scsi_unlock(host)   spin_unlock_irq(host->host_lock)
 
#define scsi_lock(host)   spin_lock_irq(host->host_lock)
 
#define lock_state(chip)   spin_lock_irq(&((chip)->rtsx->reg_lock))
 
#define unlock_state(chip)   spin_unlock_irq(&((chip)->rtsx->reg_lock))
 

Typedefs

typedef unsigned long DELAY_PARA_T
 
typedef struct rtsx_dev rtsx_dev_t
 

Enumerations

enum  xfer_buf_dir {
  TO_XFER_BUF, FROM_XFER_BUF, TO_XFER_BUF, FROM_XFER_BUF,
  TO_XFER_BUF, FROM_XFER_BUF, TO_XFER_BUF, FROM_XFER_BUF
}
 

Functions

int rtsx_read_pci_cfg_byte (u8 bus, u8 dev, u8 func, u8 offset, u8 *val)
 

Macro Definition Documentation

#define CR_DRIVER_NAME   "rts_pstor"

Definition at line 54 of file rtsx.h.

#define lock_state (   chip)    spin_lock_irq(&((chip)->rtsx->reg_lock))

Definition at line 178 of file rtsx.h.

#define pci_get_bus_and_slot (   bus,
  devfn 
)    pci_get_domain_bus_and_slot(0, (bus), (devfn))

Definition at line 56 of file rtsx.h.

#define rtsx_read_config_byte (   chip,
  where,
  val 
)    pci_read_config_byte((chip)->rtsx->pci, where, val)

Definition at line 75 of file rtsx.h.

#define rtsx_readb (   chip,
  reg 
)    ioread8((chip)->rtsx->remap_addr + reg)

Definition at line 72 of file rtsx.h.

#define rtsx_readl (   chip,
  reg 
)    ioread32((chip)->rtsx->remap_addr + reg)

Definition at line 64 of file rtsx.h.

#define rtsx_readw (   chip,
  reg 
)    ioread16((chip)->rtsx->remap_addr + reg)

Definition at line 68 of file rtsx.h.

#define rtsx_write_config_byte (   chip,
  where,
  val 
)    pci_write_config_byte((chip)->rtsx->pci, where, val)

Definition at line 78 of file rtsx.h.

#define rtsx_writeb (   chip,
  reg,
  value 
)    iowrite8(value, (chip)->rtsx->remap_addr + reg)

Definition at line 70 of file rtsx.h.

#define rtsx_writel (   chip,
  reg,
  value 
)    iowrite32(value, (chip)->rtsx->remap_addr + reg)

Definition at line 62 of file rtsx.h.

#define rtsx_writew (   chip,
  reg,
  value 
)    iowrite16(value, (chip)->rtsx->remap_addr + reg)

Definition at line 66 of file rtsx.h.

#define scsi_lock (   host)    spin_lock_irq(host->host_lock)

Definition at line 176 of file rtsx.h.

#define SCSI_LUN (   srb)    ((srb)->device->lun)

Definition at line 98 of file rtsx.h.

#define scsi_unlock (   host)    spin_unlock_irq(host->host_lock)

Definition at line 175 of file rtsx.h.

#define STATE_TRANS_BUF   2

Definition at line 91 of file rtsx.h.

#define STATE_TRANS_CMD   1

Definition at line 90 of file rtsx.h.

#define STATE_TRANS_NONE   0

Definition at line 89 of file rtsx.h.

#define STATE_TRANS_SG   3

Definition at line 92 of file rtsx.h.

#define TRANS_NOT_READY   0

Definition at line 94 of file rtsx.h.

#define TRANS_RESULT_FAIL   2

Definition at line 96 of file rtsx.h.

#define TRANS_RESULT_OK   1

Definition at line 95 of file rtsx.h.

#define unlock_state (   chip)    spin_unlock_irq(&((chip)->rtsx->reg_lock))

Definition at line 179 of file rtsx.h.

#define wait_timeout (   msecs)    wait_timeout_x(TASK_INTERRUPTIBLE, (msecs))

Definition at line 86 of file rtsx.h.

#define wait_timeout_x (   task_state,
  msecs 
)
Value:
do { \
set_current_state((task_state)); \
schedule_timeout((msecs) * HZ / 1000); \
} while (0)

Definition at line 81 of file rtsx.h.

Typedef Documentation

typedef unsigned long DELAY_PARA_T

Definition at line 100 of file rtsx.h.

Definition at line 142 of file rtsx.h.

Enumeration Type Documentation

Enumerator:
TO_XFER_BUF 
FROM_XFER_BUF 
TO_XFER_BUF 
FROM_XFER_BUF 
TO_XFER_BUF 
FROM_XFER_BUF 
TO_XFER_BUF 
FROM_XFER_BUF 

Definition at line 182 of file rtsx.h.

Function Documentation

int rtsx_read_pci_cfg_byte ( u8  bus,
u8  dev,
u8  func,
u8  offset,
u8 val 
)

Definition at line 329 of file rtsx.c.