Merge branch 'mr-origin-258'

parents 7bcf11f7 14dd8e0b
......@@ -409,14 +409,12 @@ CONFIG_USB_NET_AQC111=m
# CONFIG_WLAN_VENDOR_REALTEK is not set
CONFIG_RSI_91X=m
# CONFIG_RSI_USB is not set
CONFIG_RSI_PURISM=y
CONFIG_REDPINE_91X=m
CONFIG_RS9116_PURISM=y
CONFIG_REDPINE_LOAD_FW_FROM_FLASH_ONLY=y
CONFIG_RS9116_FLASH_MODE=y
# CONFIG_REDPINE_USB is not set
CONFIG_REDPINE_BT_ALONE=y
CONFIG_REDPINE_COEX_MODE=y
CONFIG_REDPINE_WOW=y
CONFIG_HW_SCAN_OFFLOAD=y
CONFIG_REDPINE_PURISM=y
# CONFIG_WLAN_VENDOR_ST is not set
# CONFIG_WLAN_VENDOR_TI is not set
# CONFIG_WLAN_VENDOR_ZYDAS is not set
......
......@@ -74,14 +74,6 @@ config REDPINE_P2P
This option enables the Wi-Fi Direct support in rsi drivers.
Select Y, if you have to use this feature.
config HW_SCAN_OFFLOAD
bool "Redpine Signals Hardware scan offload feature"
depends on REDPINE_91X
default n
help
This option enables the hardware scan offload option in rsi drivers.
Select Y, if you have to use this feature.
config CARACALLA_BOARD
bool "Redpine device support on Caracalla board"
depends on REDPINE_91X
......@@ -98,12 +90,28 @@ config REDPINE_ZIGB
This option is used to support Zigbee with REDPINE driver.
Select Y, if you have to use this support.
config REDPINE_PURISM
bool "Redpine Signals PURISM FW support"
config RS9116_FLASH_MODE
bool "Redpine Signals RS9116 chip Flash mode FW load support"
depends on REDPINE_91X && REDPINE_COEX_MODE
default n
help
This option enables Flash mode FW load support for RS9116.
Say Y if you want to use this feature.
config RS9116_PURISM
bool "Redpine Signals PURISM FW support"
depends on REDPINE_91X && REDPINE_COEX_MODE && RS9116_FLASH_MODE
default n
help
This option enables the PURISM FW support.
Say Y if you want to use this feature.
config REDPINE_LOAD_FW_FROM_FLASH_ONLY
bool "Redpine Signals load fw from flash only"
depends on REDPINE_91X && REDPINE_COEX_MODE && RS9116_FLASH_MODE
default n
help
This option enables the load fw from flash only mode.
Say Y if you want to use this feature.
endif # WLAN_VENDOR_REDPINE
......@@ -36,6 +36,7 @@ redpine_91x-y += rsi_91x_hal.o
redpine_91x-y += rsi_91x_ps.o
redpine_91x-$(CONFIG_REDPINE_DEBUGFS) += rsi_91x_debugfs.o
redpine_91x-$(CONFIG_REDPINE_BT_ALONE) += rsi_91x_hci.o
redpine_91x-$(CONFIG_RSI_BT_ANDROID) += rsi_91x_bluedroid.o
redpine_91x-$(CONFIG_REDPINE_COEX_MODE) += rsi_91x_coex.o
redpine_91x-$(CONFIG_REDPINE_COEX_MODE) += rsi_91x_hci.o
redpine_91x-$(CONFIG_REDPINE_ZIGB) += rsi_91x_zigb.o
......
This diff is collapsed.
This diff is collapsed.
......@@ -96,18 +96,22 @@ static void rsi_coex_scheduler_thread(struct rsi_common *common)
int status = 0;
struct rsi_coex_ctrl_block *coex_cb =
(struct rsi_coex_ctrl_block *)common->coex_cb;
u32 timeout = EVENT_WAIT_FOREVER;
do {
status = rsi_wait_event(&coex_cb->coex_tx_thread.event, timeout);
status = rsi_wait_event(&coex_cb->coex_tx_thread.event,
timeout);
if (status < 0)
break;
rsi_reset_event(&coex_cb->coex_tx_thread.event);
rsi_coex_sched_tx_pkts(coex_cb);
status = redpine_set_clr_tx_intention(common, BT_ZB_ID, 1);
if (!status)
rsi_coex_sched_tx_pkts(coex_cb);
else
redpine_dbg(ERR_ZONE, "%s,%d: Failed to get tx_access\n",
__func__, __LINE__);
redpine_set_clr_tx_intention(common, BT_ZB_ID, 0);
} while (atomic_read(&coex_cb->coex_tx_thread.thread_done) == 0);
complete_and_exit(&coex_cb->coex_tx_thread.completion, 0);
}
......
......@@ -160,8 +160,7 @@ static u8 rsi_core_determine_hal_queue(struct rsi_common *common)
}
if (skb_queue_len(&common->tx_queue[MGMT_SOFT_Q])) {
if (!common->mgmt_q_block)
q_num = MGMT_SOFT_Q;
q_num = MGMT_SOFT_Q;
return q_num;
}
......@@ -473,6 +472,8 @@ void rsi_core_xmit(struct rsi_common *common, struct sk_buff *skb)
bss = &adapter->vifs[0]->bss_conf;
common->eapol4_confirm = 0;
common->start_bgscan = 0;
redpine_dbg(MGMT_DEBUG_ZONE,
"<==== Sending ASSOCIATION REQUEST Packet ====>\n");
rsi_send_sta_notify_frame(common, STA_OPMODE,
STA_CONNECTED,
bss->bssid, bss->qos,
......@@ -492,17 +493,6 @@ void rsi_core_xmit(struct rsi_common *common, struct sk_buff *skb)
#endif
redpine_dbg(MGMT_TX_ZONE, "Core: TX Dot11 Mgmt Pkt Type: %s\n",
dot11_pkt_type(wlh->frame_control));
#ifndef CONFIG_REDPINE_HW_SCAN_OFFLOAD
if (ieee80211_is_probe_req(wlh->frame_control)) {
if ((is_broadcast_ether_addr(wlh->addr1)) &&
(skb->data[MIN_802_11_HDR_LEN + 1] == 0) &&
(skb->len < 120)) {
memcpy(common->bgscan_probe_req,
skb->data, skb->len);
common->bgscan_probe_req_len = skb->len;
}
}
#endif
if (rsi_prepare_mgmt_desc(common, skb)) {
redpine_dbg(ERR_ZONE, "Failed to prepeare desc\n");
goto xmit_fail;
......
/*
* Copyright (c) 2017 Redpine Signals Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION). HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/gpio.h>
#include "rsi_main.h"
#include "rsi_gpio.h"
/**
* redpine_gpio_deinit(): to de-initialize gpio
* @return:
* @params:
*/
void redpine_gpio_deinit(struct rsi_common *common)
{
gpio_free(common->ulp_gpio_read);
gpio_free(common->ulp_gpio_write);
}
EXPORT_SYMBOL_GPL(redpine_gpio_deinit);
/**
* redpine_gpio_init(): to initialize gpio
* @return:
* @params:
*/
void redpine_gpio_init(struct rsi_common *common)
{
int rc = 0;
char *read_gpio = "device_status";
char *write_gpio = "host_intention";
/* gpio_free() is dangerous to use.FIXME*/
gpio_free(common->ulp_gpio_read);
gpio_free(common->ulp_gpio_write);
rc = gpio_request(common->ulp_gpio_write, write_gpio);
if (rc) {
redpine_dbg(ERR_ZONE, "%s: %s setup failed with err: %d\n",
__func__, write_gpio, rc);
return;
}
rc = gpio_request(common->ulp_gpio_read, read_gpio);
if (rc) {
redpine_dbg(ERR_ZONE, "%s: %s setup failed with err: %d\n",
__func__, read_gpio, rc);
return;
}
rc = gpio_direction_output(common->ulp_gpio_write, 0);
if (rc) {
redpine_dbg(ERR_ZONE, "%s: failed to set %s direction, err: %d\n",
__func__, write_gpio, rc);
return;
}
rc = gpio_direction_input(common->ulp_gpio_read);
if (rc) {
redpine_dbg(ERR_ZONE, "%s: failed to set %s direction, err: %d\n",
__func__, read_gpio, rc);
return;
}
}
EXPORT_SYMBOL_GPL(redpine_gpio_init);
/**
* redpine_set_host_status() - This function is used to toggle host gpio.
*
* @value: The value of the host gpio either TRUE or FALSE.
*
* Return: None.
*/
void redpine_set_host_status(int value, struct rsi_common *common)
{
__gpio_set_value(common->ulp_gpio_write, value);
}
EXPORT_SYMBOL_GPL(redpine_set_host_status);
/**
* redpine_get_device_status() - This function is used to read the LMAC gpio to find
* the LMAC sleep status.
*
* Return: True if gpio status high, false if gpio status low.
*/
int redpine_get_device_status(struct rsi_common *common)
{
return __gpio_get_value(common->ulp_gpio_read);
}
EXPORT_SYMBOL_GPL(redpine_get_device_status);
This diff is collapsed.
......@@ -103,13 +103,16 @@ static int rsi_hci_send_pkt(struct sk_buff *skb)
static int rsi_hci_send_pkt(struct hci_dev *hdev, struct sk_buff *skb)
#endif
{
struct rsi_hci_adapter *h_adapter;
struct rsi_hci_adapter *h_adapter = NULL;
struct sk_buff *new_skb = NULL;
#if LINUX_VERSION_CODE < KERNEL_VERSION (3, 13, 0)
struct hci_dev *hdev = (struct hci_dev *)skb->dev;
#endif
int status = 0;
if (!hdev) {
status = -ENOMEM;
goto fail;
}
if (skb->len <= 0) {
redpine_dbg(ERR_ZONE, "Zero length packet\n");
//hdev->sta.err_tx++;
......@@ -132,12 +135,13 @@ static int rsi_hci_send_pkt(struct hci_dev *hdev, struct sk_buff *skb)
}
#endif
#ifndef CONFIG_REDPINE_BT_ANDROID
if (h_adapter->priv->bt_fsm_state != BT_DEVICE_READY) {
redpine_dbg(ERR_ZONE, "BT Device not ready\n");
status = -ENODEV;
goto fail;
}
#endif
if (!test_bit(HCI_RUNNING, &hdev->flags)) {
status = -EBUSY;
goto fail;
......@@ -173,7 +177,7 @@ static int rsi_hci_send_pkt(struct hci_dev *hdev, struct sk_buff *skb)
#else
bt_cb(new_skb)->pkt_type = bt_cb((skb))->pkt_type;
#endif
kfree_skb(skb);
dev_kfree_skb(skb);
skb = new_skb;
if (!IS_ALIGNED((unsigned long)skb->data, RSI_DMA_ALIGN))
skb = rsi_get_aligned_skb(skb);
......@@ -189,7 +193,11 @@ static int rsi_hci_send_pkt(struct hci_dev *hdev, struct sk_buff *skb)
return 0;
fail:
#ifndef CONFIG_REDPINE_BT_ANDROID
kfree_skb(skb);
#else
dev_kfree_skb(skb);
#endif
return status;
}
......@@ -322,6 +330,11 @@ int rsi_hci_recv_pkt(struct rsi_common *common, u8 *pkt)
skb->dev = (void *)hdev;
bt_cb(skb)->pkt_type = pkt[14];
#ifdef CONFIG_REDPINE_BT_ANDROID
rsi_send_to_stack(common, skb);
dev_kfree_skb(skb);
return 0;
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0)
return hci_recv_frame(skb);
#else
......@@ -392,8 +405,20 @@ int rsi_hci_attach(struct rsi_common *common)
__func__, status);
goto err;
}
#ifdef CONFIG_REDPINE_BT_ANDROID
rsi_init_event(&common->rsi_btchr_read_wait);
status = rsi_bdroid_init(common);
if (status < 0) {
redpine_dbg(ERR_ZONE,
"%s: HCI registration failed with errcode %d\n",
__func__, status);
goto err;
}
#endif
#ifndef CONFIG_REDPINE_BT_ANDROID
redpine_dbg(INIT_ZONE, "HCI Interface Created with name \'%s\'\n",
hdev->name);
#endif
common->bt_fsm_state = BT_DEVICE_READY;
redpine_dbg(ERR_ZONE, " HCI module init done...\n");
......@@ -429,6 +454,9 @@ void rsi_hci_detach(struct rsi_common *common)
if (!h_adapter)
return;
#ifdef CONFIG_REDPINE_BT_ANDROID
rsi_bdroid_deinit(common);
#endif
hdev = h_adapter->hdev;
if (hdev) {
//hci_dev_hold(hdev);
......
This diff is collapsed.
This diff is collapsed.
......@@ -35,6 +35,7 @@
#include "rsi_mgmt.h"
#include "rsi_common.h"
#include "rsi_ps.h"
#include "rsi_gpio.h"
/**
* str_psstate() - return the ps state in string format.
......@@ -79,30 +80,31 @@ static inline void rsi_modify_ps_state(struct rsi_hw *adapter,
}
/**
* rsi_default_ps_params() - Initalization of default powersave parameters.
* redpine_default_ps_params() - Initalization of default powersave parameters.
*
* @adapter: pointer to rsi_hw structure.
*
* return: void.
*/
void rsi_default_ps_params(struct rsi_hw *adapter)
void redpine_default_ps_params(struct rsi_hw *adapter)
{
struct rsi_ps_info *ps_info = &adapter->ps_info;
ps_info->enabled = true;
ps_info->sleep_type = 1; /* LP */
ps_info->sleep_type = redpine_ps_sleep_type;
ps_info->tx_threshold = 0;
ps_info->rx_threshold = 0;
ps_info->tx_hysterisis = 0;
ps_info->rx_hysterisis = 0;
ps_info->monitor_interval = 0;
ps_info->listen_interval = 2 * 100;
ps_info->listen_interval_duration = 0;
ps_info->num_bcns_per_lis_int = 0;
ps_info->dtim_interval_duration = 0;
ps_info->num_dtims_per_sleep = 0;
ps_info->deep_sleep_wakeup_period = 0;
ps_info->num_dtims_per_sleep = 1;
ps_info->deep_sleep_wakeup_period = 100;
ps_info->uapsd_wakeup_period = RSI_UAPSD_WAKEUP_PERIOD;
}
EXPORT_SYMBOL_GPL(rsi_default_ps_params);
EXPORT_SYMBOL_GPL(redpine_default_ps_params);
/**
* rsi_enable_ps() - enable power save
......@@ -200,3 +202,163 @@ int rsi_handle_ps_confirm(struct rsi_hw *adapter, u8 *msg)
return 0;
}
int redpine_protocol_tx_access(struct rsi_common *common)
{
u8 ii = 0;
for (ii = 0; ii < MAX_IDS; ii++) {
if (common->techs[ii].tx_intention)
return 1;
}
return 0;
}
EXPORT_SYMBOL(redpine_protocol_tx_access);
void redpine_sleep_exit_recvd(struct rsi_common *common)
{
u8 proto_id = 0;
down(&common->tx_access_lock);
common->common_hal_tx_access = true;
up(&common->tx_access_lock);
while (proto_id < MAX_IDS) {
if (common->techs[proto_id].wait_for_tx_access) {
common->techs[proto_id].wait_for_tx_access = 0;
redpine_dbg(INFO_ZONE,
"Waking up Event for proto %d\n", proto_id);
wake_up(&common->techs[proto_id].tx_access_event);
}
proto_id++;
}
}
EXPORT_SYMBOL(redpine_sleep_exit_recvd);
#if defined(CONFIG_ARCH_HAVE_CUSTOM_GPIO_H)
#define MAX_RETRY_LIMIT 30
/*
* process_tx_gpio_hand_shake() - This function performs GPIO handshake
* between host driver and LMAC to grant tx_access for host.
*
* @proto_id: ID of the protocol that calls the function.
* @set: Used to set/reset tx_intention for host.
*
* Return: None.
*/
int process_tx_gpio_handshake(struct rsi_common *common, u8 proto_id, u8 set)
{
struct wireless_techs *tech;
int retry_count = 0;
tech = &common->techs[proto_id];
if (!set) {
tech->tx_intention = false;
/*
* Every thread sets their tx_intention bits indivdually before
* dequeuing their respective packets, once if any thread
* finishes its job it should clear its tx_intention bit, but
* it needs to check all the other threads tx_intention bits
* before pulling the host gpio down, because other threads
* still need the tx access.
*/
if (!redpine_protocol_tx_access(common)) {
common->common_hal_tx_access = false;
redpine_set_host_status(set, common);
}
return 0;
}
/* Set intention */
redpine_set_host_status(set, common);
tech->tx_intention = true;
retry_to_wake_lmac:
if (!redpine_get_device_status(common)) {
while (1) {
msleep(1); // Device need some delay to wake up
if (redpine_get_device_status(common)) {
/*
* Check the GPIO status after some delay, just
* to confirm its stablity.
*/
msleep(2);
if (redpine_get_device_status(common)) {
common->common_hal_tx_access = true;
break;
}
continue;
}
if (retry_count++ > MAX_RETRY_LIMIT) {
redpine_dbg(ERR_ZONE, "%s: Retry limit crossed\n",
__func__);
return -ETIME;
}
}
} else {
msleep(2);
if (redpine_get_device_status(common))
common->common_hal_tx_access = true;
else
goto retry_to_wake_lmac;
}
return 0;
}
#endif
int redpine_set_clr_tx_intention(struct rsi_common *common, u8 proto_id, u8 set)
{
struct wireless_techs *tech;
struct rsi_hw *adapter;
int status = 0;
adapter = common->priv;
tech = &common->techs[proto_id];
down(&common->tx_access_lock);
#if defined(CONFIG_ARCH_HAVE_CUSTOM_GPIO_H)
if (common->lp_ps_handshake_mode == GPIO_HAND_SHAKE ||
common->ulp_ps_handshake_mode == GPIO_HAND_SHAKE)
{
status = process_tx_gpio_handshake(common, proto_id, set);
up(&common->tx_access_lock);
return status;
}
#endif
if (!set) {
tech->tx_intention = 0;
if (common->sleep_entry_received &&
!common->ulp_sleep_ack_sent) {
if (!redpine_protocol_tx_access(common)) {
common->common_hal_tx_access = false;
redpine_send_ack_for_ulp_entry(common);
}
}
up(&common->tx_access_lock);
}else {
tech->tx_intention = 1;
if (adapter->rsi_host_intf == RSI_HOST_INTF_USB &&
adapter->usb_intf_in_suspend) {
redpine_dbg(INFO_ZONE,
"Changing resume timeout as pkt in pending\n");
mod_timer(&common->suspend_timer,
msecs_to_jiffies(1) + jiffies);
}
up(&common->tx_access_lock);
if (!common->common_hal_tx_access) {
tech->wait_for_tx_access = true;
if (wait_event_timeout(tech->tx_access_event,
tech->wait_for_tx_access == 0,
msecs_to_jiffies(6000))) {
if (!common->common_hal_tx_access) {
redpine_dbg(ERR_ZONE,
"%s,%d: Unable to get tx_access\n",
__func__, __LINE__);
return -EPERM;
}
} else {
redpine_dbg(ERR_ZONE, "%s,%d: Wait event failed\n",
__func__, __LINE__);
return -ETIME;
}
}
}
return status;
}
EXPORT_SYMBOL(redpine_set_clr_tx_intention);
......@@ -542,6 +542,7 @@ int rsi_prepare_frame_rpt(struct rsi_common *common, u8 *msg, int len)
#else
u8 *rrm = NULL, tmp[6];
#endif
int status = 0;
struct sk_buff *skb = NULL;
struct frame_report *frame_rpt;
u8 frame_len, frame_rpt_len;
......@@ -560,6 +561,12 @@ int rsi_prepare_frame_rpt(struct rsi_common *common, u8 *msg, int len)
frame_rpt->action_body.action = IEEE80211_ACTION_RADIO_MEAS_RPT;
#ifdef RSI_DEBUG_RRM
vif = rsi_get_vif(adapter, common->mac_addr);
if(!vif) {
redpine_dbg(ERR_ZONE,
"%s: Failed to get vif\n", __func__);
status = -ENOSPC;
goto err;
}
bss = &vif->bss_conf;
frame_rpt->mac_hdr.frame_control = IEEE80211_STYPE_ACTION;
frame_rpt->mac_hdr.duration_id = 0;
......@@ -647,7 +654,12 @@ int rsi_prepare_frame_rpt(struct rsi_common *common, u8 *msg, int len)
rsi_core_xmit(common, skb);
dev_kfree_skb(common->rrm_pending_frame);
return 0;
return status;
#ifdef RSI_DEBUG_RRM
err:
dev_kfree_skb(skb);
return status;
#endif
}
int rsi_prepare_beacon_rpt(struct rsi_common *common, u8 *msg, int len)
......@@ -659,6 +671,7 @@ int rsi_prepare_beacon_rpt(struct rsi_common *common, u8 *msg, int len)
#else
u8 tmp[6], *rrm = NULL;
#endif
int status = 0;
u8 frame_len, bcon_rpt_len;
u8 extended_desc = msg[4], frame_body_len;
struct sk_buff *skb = NULL;
......@@ -678,6 +691,12 @@ int rsi_prepare_beacon_rpt(struct rsi_common *common, u8 *msg, int len)
bcon_rpt->action_body.action = IEEE80211_ACTION_RADIO_MEAS_RPT;
#ifdef RSI_DEBUG_RRM
vif = rsi_get_vif(adapter, common->mac_addr);
if(!vif) {
redpine_dbg(ERR_ZONE,
"%s: Failed to get vif\n", __func__);
status = -ENOSPC;
goto err;
}
bss = &vif->bss_conf;
bcon_rpt->mac_hdr.frame_control = IEEE80211_STYPE_ACTION;
bcon_rpt->mac_hdr.duration_id = 0;
......@@ -736,7 +755,12 @@ int rsi_prepare_beacon_rpt(struct rsi_common *common, u8 *msg, int len)
rsi_core_xmit(common, skb);
dev_kfree_skb(common->rrm_pending_frame);
return 0;
return status;
#ifdef RSI_DEBUG_RRM
err:
dev_kfree_skb(skb);
return status;
#endif
}
void rsi_rrm_recv_cmd_frame(struct rsi_common *common, u8 *msg, int len)
......
......@@ -33,6 +33,7 @@
#include "rsi_common.h"
#include "rsi_hal.h"
#include "rsi_hci.h"
#include "rsi_mgmt.h"
/**
......@@ -246,7 +247,7 @@ static void rsi_reset_chip(struct rsi_hw *adapter)
if (rsi_sdio_read_register(adapter,
RSI_FN1_INT_REGISTER,
&sdio_interrupt_status) < 0) {
redpine_dbg(ERR_ZONE, "%s: Failed to Read Intr Status Register\n",
redpine_dbg(INFO_ZONE, "%s: Failed to Read Intr Status Register\n",
__func__);
goto err;
}
......@@ -1190,9 +1191,8 @@ static int rsi_init_sdio_interface(struct rsi_hw *adapter,
sdio_release_host(pfunction);
adapter->determine_event_timeout = rsi_sdio_determine_event_timeout;
adapter->process_isr_hci = rsi_rx_handler;
adapter->check_intr_status_reg = rsi_read_intr_status_reg;
#ifdef CONFIG_REDPINE_DEBUGFS
adapter->num_debugfs_entries = MAX_DEBUGFS_ENTRIES;
#endif
......@@ -1293,6 +1293,9 @@ static int rsi_probe(struct sdio_func *pfunction,
goto fail_kill_thread;
}
/*Receive buffer for handling RX interrupts in case of memory full*/
sdev->temp_rcv_buf = kzalloc((RCV_BUFF_LEN *4), GFP_KERNEL);
#ifdef CONFIG_SDIO_INTR_POLL
init_sdio_intr_status_poll_thread(adapter->priv);
#endif
......@@ -1318,7 +1321,10 @@ static int rsi_probe(struct sdio_func *pfunction,
redpine_dbg(INIT_ZONE, "%s: Setting ms word to 0x41050000\n", __func__);
adapter->priv->hibernate_resume = false;
#if defined(CONFIG_ARCH_HAVE_CUSTOM_GPIO_H)
if (common->ulp_ps_handshake_mode == GPIO_HAND_SHAKE)
redpine_gpio_init(common);
#endif
return 0;
fail_dev_init:
......@@ -1327,6 +1333,7 @@ static int rsi_probe(struct sdio_func *pfunction,
sdio_release_host(pfunction);
fail_claim_irq:
rsi_kill_thread(&sdev->rx_thread);
kfree(sdev->temp_rcv_buf);
fail_kill_thread:
sdio_claim_host(pfunction);
sdio_disable_func(pfunction);
......@@ -1349,13 +1356,20 @@ static int rsi_probe(struct sdio_func *pfunction,
static void rsi_disconnect(struct sdio_func *pfunction)
{
struct rsi_hw *adapter = sdio_get_drvdata(pfunction);
struct rsi_common *common = adapter->priv;
struct rsi_91x_sdiodev *dev;
int status;
if (!adapter)
return;