static int il3945_rx_init(struct il_priv *il, struct il_rx_queue *rxq)
{
- il_write_direct32(il, FH39_RCSR_RBD_BASE(0), rxq->bd_dma);
- il_write_direct32(il, FH39_RCSR_RPTR_ADDR(0),
+ il_wr(il, FH39_RCSR_RBD_BASE(0), rxq->bd_dma);
+ il_wr(il, FH39_RCSR_RPTR_ADDR(0),
rxq->rb_stts_dma);
- il_write_direct32(il, FH39_RCSR_WPTR(0), 0);
- il_write_direct32(il, FH39_RCSR_CONFIG(0),
+ il_wr(il, FH39_RCSR_WPTR(0), 0);
+ il_wr(il, FH39_RCSR_CONFIG(0),
FH39_RCSR_RX_CONFIG_REG_VAL_DMA_CHNL_EN_ENABLE |
FH39_RCSR_RX_CONFIG_REG_VAL_RDRBD_EN_ENABLE |
FH39_RCSR_RX_CONFIG_REG_BIT_WR_STTS_EN |
FH39_RCSR_RX_CONFIG_REG_VAL_MSG_MODE_FH);
/* fake read to flush all prev I/O */
- il_read_direct32(il, FH39_RSSR_CTRL);
+ il_rd(il, FH39_RSSR_CTRL);
return 0;
}
il_write_prph(il, ALM_SCD_TXF4MF_REG, 0x000004);
il_write_prph(il, ALM_SCD_TXF5MF_REG, 0x000005);
- il_write_direct32(il, FH39_TSSR_CBB_BASE,
+ il_wr(il, FH39_TSSR_CBB_BASE,
il->_3945.shared_phys);
- il_write_direct32(il, FH39_TSSR_MSG_CONFIG,
+ il_wr(il, FH39_TSSR_MSG_CONFIG,
FH39_TSSR_TX_MSG_CONFIG_REG_VAL_SNOOP_RD_TXPD_ON |
FH39_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RD_TXPD_ON |
FH39_TSSR_TX_MSG_CONFIG_REG_VAL_MAX_FRAG_SIZE_128B |
il_rx_queue_update_write_ptr(il, rxq);
*/
- il_write_direct32(il, FH39_RCSR_WPTR(0), rxq->write & ~7);
+ il_wr(il, FH39_RCSR_WPTR(0), rxq->write & ~7);
rc = il3945_txq_ctx_reset(il);
if (rc)
/* reset TFD queues */
for (txq_id = 0; txq_id < il->hw_params.max_txq_num; txq_id++) {
- il_write_direct32(il, FH39_TCSR_CONFIG(txq_id), 0x0);
- il_poll_direct_bit(il, FH39_TSSR_TX_STATUS,
+ il_wr(il, FH39_TCSR_CONFIG(txq_id), 0x0);
+ il_poll_bit(il, FH39_TSSR_TX_STATUS,
FH39_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE(txq_id),
1000);
}
{
int rc;
- il_write_direct32(il, FH39_RCSR_CONFIG(0), 0);
- rc = il_poll_direct_bit(il, FH39_RSSR_STATUS,
+ il_wr(il, FH39_RCSR_CONFIG(0), 0);
+ rc = il_poll_bit(il, FH39_RSSR_STATUS,
FH39_RSSR_CHNL0_RX_STATUS_CHNL_IDLE, 1000);
if (rc < 0)
IL_ERR("Can't stop Rx DMA.\n");
shared_data->tx_base_ptr[txq_id] = cpu_to_le32((u32)txq->q.dma_addr);
- il_write_direct32(il, FH39_CBCC_CTRL(txq_id), 0);
- il_write_direct32(il, FH39_CBCC_BASE(txq_id), 0);
+ il_wr(il, FH39_CBCC_CTRL(txq_id), 0);
+ il_wr(il, FH39_CBCC_BASE(txq_id), 0);
- il_write_direct32(il, FH39_TCSR_CONFIG(txq_id),
+ il_wr(il, FH39_TCSR_CONFIG(txq_id),
FH39_TCSR_TX_CONFIG_REG_VAL_CIRQ_RTC_NOINT |
FH39_TCSR_TX_CONFIG_REG_VAL_MSG_MODE_TXF |
FH39_TCSR_TX_CONFIG_REG_VAL_CIRQ_HOST_IFTFD |
rb_size = FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_4K;
/* Stop Rx DMA */
- il_write_direct32(il, FH_MEM_RCSR_CHNL0_CONFIG_REG, 0);
+ il_wr(il, FH_MEM_RCSR_CHNL0_CONFIG_REG, 0);
/* Reset driver's Rx queue write index */
- il_write_direct32(il, FH_RSCSR_CHNL0_RBDCB_WPTR_REG, 0);
+ il_wr(il, FH_RSCSR_CHNL0_RBDCB_WPTR_REG, 0);
/* Tell device where to find RBD circular buffer in DRAM */
- il_write_direct32(il, FH_RSCSR_CHNL0_RBDCB_BASE_REG,
+ il_wr(il, FH_RSCSR_CHNL0_RBDCB_BASE_REG,
(u32)(rxq->bd_dma >> 8));
/* Tell device where in DRAM to update its Rx status */
- il_write_direct32(il, FH_RSCSR_CHNL0_STTS_WPTR_REG,
+ il_wr(il, FH_RSCSR_CHNL0_STTS_WPTR_REG,
rxq->rb_stts_dma >> 4);
/* Enable Rx DMA
* RB timeout 0x10
* 256 RBDs
*/
- il_write_direct32(il, FH_MEM_RCSR_CHNL0_CONFIG_REG,
+ il_wr(il, FH_MEM_RCSR_CHNL0_CONFIG_REG,
FH_RCSR_RX_CONFIG_CHNL_EN_ENABLE_VAL |
FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_INT_HOST_VAL |
FH_RCSR_CHNL0_RX_CONFIG_SINGLE_FRAME_MSK |
{
/* stop Rx DMA */
- il_write_direct32(il, FH_MEM_RCSR_CHNL0_CONFIG_REG, 0);
- il_poll_direct_bit(il, FH_MEM_RSSR_RX_STATUS_REG,
+ il_wr(il, FH_MEM_RCSR_CHNL0_CONFIG_REG, 0);
+ il_poll_bit(il, FH_MEM_RSSR_RX_STATUS_REG,
FH_RSSR_CHNL0_RX_STATUS_CHNL_IDLE, 1000);
return 0;
pos += scnprintf(*buf + pos, bufsz - pos,
" %34s: 0X%08x\n",
il4965_get_fh_string(fh_tbl[i]),
- il_read_direct32(il, fh_tbl[i]));
+ il_rd(il, fh_tbl[i]));
}
return pos;
}
for (i = 0; i < ARRAY_SIZE(fh_tbl); i++) {
IL_ERR(" %34s: 0X%08x\n",
il4965_get_fh_string(fh_tbl[i]),
- il_read_direct32(il, fh_tbl[i]));
+ il_rd(il, fh_tbl[i]));
}
return 0;
}
il4965_txq_set_sched(il, 0);
/* Tell NIC where to find the "keep warm" buffer */
- il_write_direct32(il, FH_KW_MEM_ADDR_REG, il->kw.dma >> 4);
+ il_wr(il, FH_KW_MEM_ADDR_REG, il->kw.dma >> 4);
spin_unlock_irqrestore(&il->lock, flags);
il4965_txq_set_sched(il, 0);
/* Tell NIC where to find the "keep warm" buffer */
- il_write_direct32(il, FH_KW_MEM_ADDR_REG, il->kw.dma >> 4);
+ il_wr(il, FH_KW_MEM_ADDR_REG, il->kw.dma >> 4);
spin_unlock_irqrestore(&il->lock, flags);
/* Stop each Tx DMA channel, and wait for it to be idle */
for (ch = 0; ch < il->hw_params.dma_chnl_num; ch++) {
- il_write_direct32(il,
+ il_wr(il,
FH_TCSR_CHNL_TX_CONFIG_REG(ch), 0x0);
- if (il_poll_direct_bit(il, FH_TSSR_TX_STATUS_REG,
+ if (il_poll_bit(il, FH_TSSR_TX_STATUS_REG,
FH_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE(ch),
1000))
IL_ERR("Failing on timeout while stopping"
" DMA channel %d [0x%08x]", ch,
- il_read_direct32(il,
+ il_rd(il,
FH_TSSR_TX_STATUS_REG));
}
spin_unlock_irqrestore(&il->lock, flags);
/* read data comes through single port, auto-incr addr */
/* NOTE: Use the debugless read so we don't flood kernel log
* if IL_DL_IO is set */
- il_write_direct32(il, HBUS_TARG_MEM_RADDR,
+ il_wr(il, HBUS_TARG_MEM_RADDR,
i + IWL4965_RTC_INST_LOWER_BOUND);
val = _il_rd(il, HBUS_TARG_MEM_RDAT);
if (val != le32_to_cpu(*image)) {
D_INFO("ucode inst image size is %u\n", len);
- il_write_direct32(il, HBUS_TARG_MEM_RADDR,
+ il_wr(il, HBUS_TARG_MEM_RADDR,
IWL4965_RTC_INST_LOWER_BOUND);
errcnt = 0;
*
* Use _il_wr() and _il_rd() family to access these registers;
* these provide simple PCI bus access, without waking up the MAC.
- * Do not use il_write_direct32() family for these registers;
+ * Do not use il_wr() family for these registers;
* no need to "grab nic access" via CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ.
* The MAC (uCode processor, etc.) does not need to be powered up for accessing
* the CSR registers.
* to indirectly access device's internal memory or registers that
* may be powered-down.
*
- * Use il_write_direct32()/il_read_direct32() family
+ * Use il_wr()/il_rd() family
* for these registers;
* host must "grab nic access" via CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ
* to make sure the MAC (uCode processor, etc.) is powered up for accessing
CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
}
-static inline u32 il_read_direct32(struct il_priv *il, u32 reg)
+static inline u32 il_rd(struct il_priv *il, u32 reg)
{
u32 value;
unsigned long reg_flags;
}
static inline void
-il_write_direct32(struct il_priv *il, u32 reg, u32 value)
+il_wr(struct il_priv *il, u32 reg, u32 value)
{
unsigned long reg_flags;
if ((il != NULL) && (values != NULL)) {
for (; 0 < len; len -= count, reg += count, values++)
- il_write_direct32(il, reg, *values);
+ il_wr(il, reg, *values);
}
}
-static inline int _il_poll_direct_bit(struct il_priv *il, u32 addr,
+static inline int il_poll_bit(struct il_priv *il, u32 addr,
u32 mask, int timeout)
{
int t = 0;
do {
- if ((il_read_direct32(il, addr) & mask) == mask)
+ if ((il_rd(il, addr) & mask) == mask)
return t;
udelay(IL_POLL_INTERVAL);
t += IL_POLL_INTERVAL;
return -ETIMEDOUT;
}
-#define il_poll_direct_bit _il_poll_direct_bit
static inline u32 _il_read_prph(struct il_priv *il, u32 reg)
{
}
q->write_actual = (q->write & ~0x7);
- il_write_direct32(il, rx_wrt_ptr_reg,
+ il_wr(il, rx_wrt_ptr_reg,
q->write_actual);
/* Else device is assumed to be awake */
} else {
/* Device expects a multiple of 8 */
q->write_actual = (q->write & ~0x7);
- il_write_direct32(il, rx_wrt_ptr_reg,
+ il_wr(il, rx_wrt_ptr_reg,
q->write_actual);
}
return;
}
- il_write_direct32(il, HBUS_TARG_WRPTR,
+ il_wr(il, HBUS_TARG_WRPTR,
txq->q.write_ptr | (txq_id << 8));
/*
il->isr_stats.tx++;
_il_wr(il, CSR_FH_INT_STATUS, (1 << 6));
- il_write_direct32(il, FH39_TCSR_CREDIT
+ il_wr(il, FH39_TCSR_CREDIT
(FH39_SRVC_CHNL), 0x0);
handled |= CSR_INT_BIT_FH_TX;
}
D_INFO("ucode inst image size is %u\n", len);
- il_write_direct32(il, HBUS_TARG_MEM_RADDR,
+ il_wr(il, HBUS_TARG_MEM_RADDR,
IWL39_RTC_INST_LOWER_BOUND);
errcnt = 0;
/* read data comes through single port, auto-incr addr */
/* NOTE: Use the debugless read so we don't flood kernel log
* if IL_DL_IO is set */
- il_write_direct32(il, HBUS_TARG_MEM_RADDR,
+ il_wr(il, HBUS_TARG_MEM_RADDR,
i + IWL39_RTC_INST_LOWER_BOUND);
val = _il_rd(il, HBUS_TARG_MEM_RDAT);
if (val != le32_to_cpu(*image)) {
int txq_id = txq->q.id;
/* Circular buffer (TFD queue in DRAM) physical base address */
- il_write_direct32(il, FH_MEM_CBBC_QUEUE(txq_id),
+ il_wr(il, FH_MEM_CBBC_QUEUE(txq_id),
txq->q.dma_addr >> 8);
return 0;
_il_wr(il, CSR_UCODE_DRV_GP1_SET,
CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED);
- il_write_direct32(il, HBUS_TARG_MBX_C,
+ il_wr(il, HBUS_TARG_MBX_C,
HBUS_TARG_MBX_C_REG_BIT_CMD_BLOCKED);
if (!(flags & RXON_CARD_DISABLED)) {
_il_wr(il, CSR_UCODE_DRV_GP1_CLR,
CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED);
- il_write_direct32(il, HBUS_TARG_MBX_C,
+ il_wr(il, HBUS_TARG_MBX_C,
HBUS_TARG_MBX_C_REG_BIT_CMD_BLOCKED);
}
}
/* Enable DMA channel */
for (chan = 0; chan < FH49_TCSR_CHNL_NUM ; chan++)
- il_write_direct32(il,
+ il_wr(il,
FH_TCSR_CHNL_TX_CONFIG_REG(chan),
FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_ENABLE |
FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_ENABLE);
/* Update FH chicken bits */
- reg_val = il_read_direct32(il, FH_TX_CHICKEN_BITS_REG);
- il_write_direct32(il, FH_TX_CHICKEN_BITS_REG,
+ reg_val = il_rd(il, FH_TX_CHICKEN_BITS_REG);
+ il_wr(il, FH_TX_CHICKEN_BITS_REG,
reg_val | FH_TX_CHICKEN_BITS_SCD_AUTO_RETRY_EN);
/* Disable chain mode for all queues */
/* TFD circular buffer read/write indexes */
il_write_prph(il, IWL49_SCD_QUEUE_RDPTR(i), 0);
- il_write_direct32(il, HBUS_TARG_WRPTR, 0 | (i << 8));
+ il_wr(il, HBUS_TARG_WRPTR, 0 | (i << 8));
/* Max Tx Window size for Scheduler-ACK mode */
il_write_targ_mem(il, il->scd_base_addr +
*/
void il4965_set_wr_ptrs(struct il_priv *il, int txq_id, u32 index)
{
- il_write_direct32(il, HBUS_TARG_WRPTR,
+ il_wr(il, HBUS_TARG_WRPTR,
(index & 0xff) | (txq_id << 8));
il_write_prph(il, IWL49_SCD_QUEUE_RDPTR(txq_id), index);
}