do {
rsi_wait_event(&sdev->rx_thread.event, EVENT_WAIT_FOREVER);
rsi_reset_event(&sdev->rx_thread.event);
rsi_rx_handler(adapter);
} while (!atomic_read(&sdev->rx_thread.thread_done));
if (!num_blks) {
status = rsi_sdio_read_register(adapter,
SDIO_RX_NUM_BLOCKS_REG,
&value); if (status) {
rsi_dbg(ERR_ZONE, "%s: Failed to read pkt length from the card:\n",
__func__); return status;
}
num_blks = value & 0x1f;
}
if (dev->write_fail == 2)
rsi_sdio_ack_intr(common->priv, (1 << MSDU_PKT_PENDING));
if (unlikely(!num_blks)) {
dev->write_fail = 2; return -1;
}
rcv_pkt_len = (num_blks * 256);
status = rsi_sdio_host_intf_read_pkt(adapter, dev->pktbuffer,
rcv_pkt_len); if (status) {
rsi_dbg(ERR_ZONE, "%s: Failed to read packet from card\n",
__func__); return status;
}
status = rsi_read_pkt(common, dev->pktbuffer, rcv_pkt_len); if (status) {
rsi_dbg(ERR_ZONE, "Failed to read the packet\n"); return status;
}
return0;
}
/** *rsi_init_sdio_slave_regs()-Thisfunctiondoestheactualinitialization *ofSDBUSslaveregisters. *@adapter:Pointertotheadapterstructure. * *Return:status:0onsuccess,-1onfailure.
*/ int rsi_init_sdio_slave_regs(struct rsi_hw *adapter)
{ struct rsi_91x_sdiodev *dev = adapter->rsi_dev;
u8 function = 0;
u8 byte; int status = 0;
if (dev->next_read_delay) {
byte = dev->next_read_delay;
status = rsi_sdio_write_register(adapter,
function,
SDIO_NXT_RD_DELAY2,
&byte); if (status) {
rsi_dbg(ERR_ZONE, "%s: Failed to write SDIO_NXT_RD_DELAY2\n",
__func__); return -1;
}
}
if (dev->sdio_high_speed_enable) {
rsi_dbg(INIT_ZONE, "%s: Enabling SDIO High speed\n", __func__);
byte = 0x3;
status = rsi_sdio_write_register(adapter,
function,
SDIO_REG_HIGH_SPEED,
&byte); if (status) {
rsi_dbg(ERR_ZONE, "%s: Failed to enable SDIO high speed\n",
__func__); return -1;
}
}
/* This tells SDIO FIFO when to start read to host */
rsi_dbg(INIT_ZONE, "%s: Initializing SDIO read start level\n", __func__);
byte = 0x24;
status = rsi_sdio_write_register(adapter,
function,
SDIO_READ_START_LVL,
&byte); if (status) {
rsi_dbg(ERR_ZONE, "%s: Failed to write SDIO_READ_START_LVL\n", __func__); return -1;
}
/* This function is used to read buffer status register and *setrelevantfieldsinrsi_91x_sdiodevstruct.
*/ int rsi_sdio_check_buffer_status(struct rsi_hw *adapter, u8 q_num)
{ struct rsi_common *common = adapter->priv; struct rsi_91x_sdiodev *dev = adapter->rsi_dev;
u8 buf_status = 0; int status = 0; staticint counter = 4;
if (!dev->buff_status_updated && counter) {
counter--; goto out;
}
dev->buff_status_updated = false;
status = rsi_sdio_read_register(common->priv,
RSI_DEVICE_BUFFER_STATUS_REGISTER,
&buf_status);
if (status) {
rsi_dbg(ERR_ZONE, "%s: Failed to read status register\n", __func__); return -1;
}
if (buf_status & (BIT(PKT_MGMT_BUFF_FULL))) { if (!dev->rx_info.mgmt_buffer_full)
dev->rx_info.mgmt_buf_full_counter++;
dev->rx_info.mgmt_buffer_full = true;
} else {
dev->rx_info.mgmt_buffer_full = false;
}
if (buf_status & (BIT(PKT_BUFF_FULL))) { if (!dev->rx_info.buffer_full)
dev->rx_info.buf_full_counter++;
dev->rx_info.buffer_full = true;
} else {
dev->rx_info.buffer_full = false;
}
if (buf_status & (BIT(PKT_BUFF_SEMI_FULL))) { if (!dev->rx_info.semi_buffer_full)
dev->rx_info.buf_semi_full_counter++;
dev->rx_info.semi_buffer_full = true;
} else {
dev->rx_info.semi_buffer_full = false;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.