提交 c6d1d87a 编写于 作者: A Avinash Patil 提交者: John W. Linville

mwifiex: add init_fw_port handler for PCIe interface

This patch adds support for init_fw_port handler for PCIe
interface, which resets RXBD read pointer for PCIe.
This fixes issue where RX doesn't work until some TX from
driver happens.
Signed-off-by: NAvinash Patil <patila@marvell.com>
Signed-off-by: NBing Zhao <bzhao@marvell.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 659c4788
...@@ -591,6 +591,12 @@ int mwifiex_init_fw(struct mwifiex_adapter *adapter) ...@@ -591,6 +591,12 @@ int mwifiex_init_fw(struct mwifiex_adapter *adapter)
return -1; return -1;
} }
} }
if (adapter->if_ops.init_fw_port) {
if (adapter->if_ops.init_fw_port(adapter))
return -1;
}
for (i = 0; i < adapter->priv_num; i++) { for (i = 0; i < adapter->priv_num; i++) {
if (adapter->priv[i]) { if (adapter->priv[i]) {
ret = mwifiex_sta_init_cmd(adapter->priv[i], first_sta); ret = mwifiex_sta_init_cmd(adapter->priv[i], first_sta);
......
...@@ -599,6 +599,7 @@ struct mwifiex_if_ops { ...@@ -599,6 +599,7 @@ struct mwifiex_if_ops {
int (*cmdrsp_complete) (struct mwifiex_adapter *, struct sk_buff *); int (*cmdrsp_complete) (struct mwifiex_adapter *, struct sk_buff *);
int (*event_complete) (struct mwifiex_adapter *, struct sk_buff *); int (*event_complete) (struct mwifiex_adapter *, struct sk_buff *);
int (*data_complete) (struct mwifiex_adapter *, struct sk_buff *); int (*data_complete) (struct mwifiex_adapter *, struct sk_buff *);
int (*init_fw_port) (struct mwifiex_adapter *);
int (*dnld_fw) (struct mwifiex_adapter *, struct mwifiex_fw_image *); int (*dnld_fw) (struct mwifiex_adapter *, struct mwifiex_fw_image *);
void (*card_reset) (struct mwifiex_adapter *); void (*card_reset) (struct mwifiex_adapter *);
}; };
......
...@@ -966,8 +966,23 @@ mwifiex_pcie_send_boot_cmd(struct mwifiex_adapter *adapter, struct sk_buff *skb) ...@@ -966,8 +966,23 @@ mwifiex_pcie_send_boot_cmd(struct mwifiex_adapter *adapter, struct sk_buff *skb)
return 0; return 0;
} }
/* /* This function init rx port in firmware which in turn enables to receive data
* This function downloads commands to the device * from device before transmitting any packet.
*/
static int mwifiex_pcie_init_fw_port(struct mwifiex_adapter *adapter)
{
struct pcie_service_card *card = adapter->card;
/* Write the RX ring read pointer in to REG_RXBD_RDPTR */
if (mwifiex_write_reg(adapter, REG_RXBD_RDPTR, card->rxbd_rdptr | 0)) {
dev_err(adapter->dev,
"RECV DATA: failed to write REG_RXBD_RDPTR\n");
return -1;
}
return 0;
}
/* This function downloads commands to the device
*/ */
static int static int
mwifiex_pcie_send_cmd(struct mwifiex_adapter *adapter, struct sk_buff *skb) mwifiex_pcie_send_cmd(struct mwifiex_adapter *adapter, struct sk_buff *skb)
...@@ -1899,6 +1914,7 @@ static struct mwifiex_if_ops pcie_ops = { ...@@ -1899,6 +1914,7 @@ static struct mwifiex_if_ops pcie_ops = {
.event_complete = mwifiex_pcie_event_complete, .event_complete = mwifiex_pcie_event_complete,
.update_mp_end_port = NULL, .update_mp_end_port = NULL,
.cleanup_mpa_buf = NULL, .cleanup_mpa_buf = NULL,
.init_fw_port = mwifiex_pcie_init_fw_port,
}; };
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册