30 #define mr32(reg) readl(regs + reg)
31 #define mw32(reg, val) writel((val), regs + reg)
32 #define mw32_f(reg, val) do { \
37 #define iow32(reg, val) outl(val, (unsigned long)(regs + reg))
38 #define ior32(reg) inl((unsigned long)(regs + reg))
39 #define iow16(reg, val) outw((unsigned long)(val, regs + reg))
40 #define ior16(reg) inw((unsigned long)(regs + reg))
41 #define iow8(reg, val) outb((unsigned long)(val, regs + reg))
42 #define ior8(reg) inb((unsigned long)(regs + reg))
79 return (port < 4) ?
readl(regs + port * 8) :
80 readl(regs2 + (port - 4) * 8);
83 static inline void mvs_write_port(
struct mvs_info *mvi,
u32 off,
u32 off2,
89 writel(val, regs + port * 8);
91 writel(val, regs2 + (port - 4) * 8);
94 static inline u32 mvs_read_port_cfg_data(
struct mvs_info *mvi,
u32 port)
100 static inline void mvs_write_port_cfg_data(
struct mvs_info *mvi,
107 static inline void mvs_write_port_cfg_addr(
struct mvs_info *mvi,
115 static inline u32 mvs_read_port_vsr_data(
struct mvs_info *mvi,
u32 port)
121 static inline void mvs_write_port_vsr_data(
struct mvs_info *mvi,
128 static inline void mvs_write_port_vsr_addr(
struct mvs_info *mvi,
136 static inline u32 mvs_read_port_irq_stat(
struct mvs_info *mvi,
u32 port)
142 static inline void mvs_write_port_irq_stat(
struct mvs_info *mvi,
149 static inline u32 mvs_read_port_irq_mask(
struct mvs_info *mvi,
u32 port)
156 static inline void mvs_write_port_irq_mask(
struct mvs_info *mvi,
187 static inline void mvs_int_sata(
struct mvs_info *mvi)
197 static inline void mvs_int_full(
struct mvs_info *mvi)
206 for (i = 0; i < mvi->
chip->n_phy; i++) {
221 static inline void mvs_start_delivery(
struct mvs_info *mvi,
u32 tx)
227 static inline u32 mvs_rx_update(
struct mvs_info *mvi)
233 static inline u32 mvs_get_prd_size(
void)
238 static inline u32 mvs_get_prd_count(
void)
243 static inline void mvs_show_pcie_usage(
struct mvs_info *mvi)
245 u16 link_stat, link_spd;
246 const char *spd[] = {
259 "mvsas: PCI-E x%u, Bandwidth Usage: %s Gbps\n",
264 static inline u32 mvs_hw_max_link_rate(
void)