Commit b3a5d2d3 authored by Darren Wu's avatar Darren Wu Committed by Luis Henriques

UBUNTU: SAUCE: Redpine RS9113 WLAN/BT driver ver. 0.9.7

BugLink: http://bugs.launchpad.net/bugs/1657682

This is the beta2 release for RS9113 driver from Redpine
Signed-off-by: default avatarDarren Wu <darren.wu@canonical.com>
Signed-off-by: default avatarShrirang Bagul <shrirang.bagul@canonical.com>
Acked-by: default avatarTim Gardner <tim.gardner@canonical.com>
Acked-by: default avatarBrad Figg <brad.figg@canonical.com>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 5867572a
EXTRA_CFLAGS += -DCONFIG_DELL_BOARD -DCONFIG_VEN_RSI_COEX -DLINUX -Wimplicit -Wstrict-prototypes -DCONFIG_VEN_RSI_DEBUGFS -DPLATFORM_X86
ven_rsi_91x-y += rsi_91x_main.o
ven_rsi_91x-y += rsi_91x_core.o
ven_rsi_91x-y += rsi_91x_mac80211.o
ven_rsi_91x-y += rsi_91x_mgmt.o
ven_rsi_91x-y += rsi_91x_hal.o
ven_rsi_91x-y += rsi_91x_ps.o
ven_rsi_91x-$(CONFIG_VEN_RSI_DEBUGFS) += rsi_91x_debugfs.o
ven_rsi_91x-y += rsi_91x_debugfs.o
ven_rsi_91x-$(CONFIG_VEN_RSI_HCI) += rsi_91x_hci.o
ven_rsi_91x-$(CONFIG_RSI_COEX) += rsi_91x_coex.o
ven_rsi_91x-y += rsi_91x_hci.o rsi_91x_coex.o
ven_rsi_usb-y += rsi_91x_usb.o rsi_91x_usb_ops.o
ven_rsi_sdio-y += rsi_91x_sdio.o rsi_91x_sdio_ops.o
......
......@@ -16,13 +16,10 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//#include "rsi_common.h"
#include "rsi_main.h"
#include "rsi_coex.h"
#include"rsi_hal.h"
#include "rsi_hal.h"
#include "rsi_mgmt.h"
static u8 rsi_coex_determine_coex_q(struct rsi_coex_ctrl_block *coex_cb)
{
......@@ -49,21 +46,21 @@ static void rsi_coex_sched_tx_pkts(struct rsi_coex_ctrl_block *coex_cb)
while (1) {
coex_q = rsi_coex_determine_coex_q(coex_cb);
rsi_dbg(INFO_ZONE, "queue = %d\n", coex_q);
ven_rsi_dbg(INFO_ZONE, "queue = %d\n", coex_q);
if (coex_q == INVALID_QUEUE) {
rsi_dbg(DATA_TX_ZONE, "No more pkt\n");
ven_rsi_dbg(DATA_TX_ZONE, "No more pkt\n");
break;
}
mutex_lock(&coex_cb->coex_tx_lock);
down(&coex_cb->tx_bus_lock);
if (coex_q == BT_Q) {
skb = skb_dequeue(&coex_cb->coex_tx_qs[BT_Q]);
rsi_send_bt_pkt(coex_cb->priv, skb);
}
mutex_unlock(&coex_cb->coex_tx_lock);
up(&coex_cb->tx_bus_lock);
}
}
......@@ -74,9 +71,11 @@ static void rsi_coex_sched_tx_pkts(struct rsi_coex_ctrl_block *coex_cb)
*
* Return: None.
*/
static void rsi_coex_scheduler_thread(struct rsi_coex_ctrl_block *coex_cb)
static void rsi_coex_scheduler_thread(struct rsi_common *common)
{
struct rsi_common *common = (struct rsi_common *)coex_cb->priv;
struct rsi_coex_ctrl_block *coex_cb =
(struct rsi_coex_ctrl_block *)common->coex_cb;
u32 timeout = EVENT_WAIT_FOREVER;
do {
......@@ -89,8 +88,18 @@ static void rsi_coex_scheduler_thread(struct rsi_coex_ctrl_block *coex_cb)
complete_and_exit(&coex_cb->coex_tx_thread.completion, 0);
}
int rsi_coex_recv_pkt(struct rsi_common *common, struct sk_buff *skb)
int rsi_coex_recv_pkt(struct rsi_common *common, u8 *msg)
{
u16 msg_type = msg[2];
if (msg_type == COMMON_CARD_READY_IND) {
ven_rsi_dbg(INFO_ZONE, "COMMON CARD READY RECEIVED\n");
rsi_handle_card_ready(common);
} else if (msg_type == SLEEP_NOTIFY_IND) {
ven_rsi_dbg(INFO_ZONE, "\n\n sleep notify RECEIVED\n");
rsi_mgmt_pkt_recv(common, msg);
}
return 0;
}
......@@ -98,7 +107,8 @@ int rsi_coex_send_pkt(struct rsi_common *common,
struct sk_buff *skb,
u8 hal_queue)
{
struct rsi_coex_ctrl_block *coex_cb = common->coex_cb;
struct rsi_coex_ctrl_block *coex_cb =
(struct rsi_coex_ctrl_block *)common->coex_cb;
int status = 0;
/* Add pkt to queue if not WLAN packet */
......@@ -108,13 +118,12 @@ int rsi_coex_send_pkt(struct rsi_common *common,
return status;
}
mutex_lock(&coex_cb->coex_tx_lock);
/* Send packet to hal */
if (skb->priority == MGMT_SOFT_Q)
status = rsi_send_mgmt_pkt(common, skb);
else
status = rsi_send_data_pkt(common, skb);
mutex_unlock(&coex_cb->coex_tx_lock);
return 0;
}
......@@ -124,32 +133,30 @@ int rsi_coex_init(struct rsi_common *common)
int cnt;
coex_cb = kzalloc(sizeof(*coex_cb), GFP_KERNEL);
if (!coex_cb) {
rsi_dbg(ERR_ZONE,
"%s: Failed allocate coex control block\n",
__func__);
if (!coex_cb)
return -ENOMEM;
}
common->coex_cb = (void *)coex_cb;
coex_cb->priv = common;
sema_init(&coex_cb->tx_bus_lock, 1);
/* Initialize co-ex queues */
for (cnt = 0; cnt < NUM_COEX_TX_QUEUES; cnt++)
skb_queue_head_init(&coex_cb->coex_tx_qs[cnt]);
mutex_init(&coex_cb->coex_tx_lock);
rsi_init_event(&coex_cb->coex_tx_thread.event);
/* Initialize co-ex thread */
if (rsi_create_kthread(common,
&coex_cb->coex_tx_thread,
rsi_coex_scheduler_thread,
"Coex-Tx-Thread")) {
rsi_dbg(ERR_ZONE, "%s: Unable to init tx thrd\n", __func__);
ven_rsi_dbg(ERR_ZONE, "%s: Unable to init tx thrd\n", __func__);
goto err;
}
return 0;
err:
return -1;
return -EINVAL;
}
void rsi_coex_deinit(struct rsi_common *common)
......@@ -168,6 +175,4 @@ void rsi_coex_deinit(struct rsi_common *common)
/* Free the coex control block */
kfree(coex_cb);
return;
}
......@@ -16,6 +16,10 @@
#include "rsi_mgmt.h"
#include "rsi_common.h"
#include "rsi_hal.h"
#ifdef CONFIG_VEN_RSI_COEX
#include "rsi_coex.h"
#endif
/**
* rsi_determine_min_weight_queue() - This function determines the queue with
......@@ -143,7 +147,7 @@ static u8 rsi_core_determine_hal_queue(struct rsi_common *common)
}
if (common->hw_data_qs_blocked) {
rsi_dbg(INFO_ZONE, "%s: data queue blocked\n", __func__);
ven_rsi_dbg(INFO_ZONE, "%s: data queue blocked\n", __func__);
return q_num;
}
......@@ -214,7 +218,7 @@ static void rsi_core_queue_pkt(struct rsi_common *common,
u8 q_num = skb->priority;
if (q_num >= NUM_SOFT_QUEUES) {
rsi_dbg(ERR_ZONE, "%s: Invalid Queue Number: q_num = %d\n",
ven_rsi_dbg(ERR_ZONE, "%s: Invalid Queue Number: q_num = %d\n",
__func__, q_num);
dev_kfree_skb(skb);
return;
......@@ -235,7 +239,7 @@ static struct sk_buff *rsi_core_dequeue_pkt(struct rsi_common *common,
u8 q_num)
{
if (q_num >= NUM_SOFT_QUEUES) {
rsi_dbg(ERR_ZONE, "%s: Invalid Queue Number: q_num = %d\n",
ven_rsi_dbg(ERR_ZONE, "%s: Invalid Queue Number: q_num = %d\n",
__func__, q_num);
return NULL;
}
......@@ -263,11 +267,11 @@ void rsi_core_qos_processor(struct rsi_common *common)
tstamp_1 = jiffies;
while (1) {
q_num = rsi_core_determine_hal_queue(common);
rsi_dbg(DATA_TX_ZONE,
ven_rsi_dbg(DATA_TX_ZONE,
"%s: Queue number = %d\n", __func__, q_num);
if (q_num == INVALID_QUEUE) {
rsi_dbg(DATA_TX_ZONE, "%s: No More Pkt\n", __func__);
ven_rsi_dbg(DATA_TX_ZONE, "%s: No More Pkt\n", __func__);
break;
}
......@@ -289,15 +293,18 @@ void rsi_core_qos_processor(struct rsi_common *common)
skb = rsi_core_dequeue_pkt(common, q_num);
if (!skb) {
rsi_dbg(ERR_ZONE, "skb null\n");
ven_rsi_dbg(ERR_ZONE, "skb null\n");
mutex_unlock(&common->tx_lock);
break;
}
#ifdef CONFIG_VEN_RSI_COEX
status = rsi_coex_send_pkt(common, skb, RSI_WLAN_Q);
#else
if (q_num == MGMT_SOFT_Q)
status = rsi_send_mgmt_pkt(common, skb);
else
status = rsi_send_data_pkt(common, skb);
#endif
if (status) {
mutex_unlock(&common->tx_lock);
......@@ -314,6 +321,61 @@ void rsi_core_qos_processor(struct rsi_common *common)
}
}
inline char *dot11_pkt_type(__le16 frame_control)
{
if (ieee80211_is_beacon(frame_control))
return "BEACON";
if (ieee80211_is_assoc_req(frame_control))
return "ASSOC_REQ";
if (ieee80211_is_assoc_resp(frame_control))
return "ASSOC_RESP";
if (ieee80211_is_reassoc_req(frame_control))
return "REASSOC_REQ";
if (ieee80211_is_reassoc_resp(frame_control))
return "REASSOC_RESP";
if (ieee80211_is_auth(frame_control))
return "AUTH";
if (ieee80211_is_probe_req(frame_control))
return "PROBE_REQ";
if (ieee80211_is_probe_resp(frame_control))
return "PROBE_RESP";
if (ieee80211_is_disassoc(frame_control))
return "DISASSOC";
if (ieee80211_is_deauth(frame_control))
return "DEAUTH";
if (ieee80211_is_action(frame_control))
return "ACTION";
if (ieee80211_is_data_qos(frame_control))
return "QOS DATA";
if (ieee80211_is_pspoll(frame_control))
return "PS_POLL";
if (ieee80211_is_nullfunc(frame_control))
return "NULL_DATA";
if (ieee80211_is_qos_nullfunc(frame_control))
return "QOS_NULL_DATA";
if (ieee80211_is_mgmt(frame_control))
return "DOT11_MGMT";
if (ieee80211_is_data(frame_control))
return "DOT11_DATA";
if (ieee80211_is_ctl(frame_control))
return "DOT11_CTRL";
return "UNKNOWN";
}
struct rsi_sta *rsi_find_sta(struct rsi_common *common, u8 *mac_addr)
{
int i;
for (i = 0; i < common->num_stations; i++) {
if (!(memcmp(common->stations[i].sta->addr,
mac_addr, ETH_ALEN)))
return &common->stations[i];
}
return NULL;
}
/**
* rsi_core_xmit() - This function transmits the packets received from mac80211
* @common: Pointer to the driver private structure.
......@@ -326,62 +388,114 @@ void rsi_core_xmit(struct rsi_common *common, struct sk_buff *skb)
struct rsi_hw *adapter = common->priv;
struct ieee80211_tx_info *info;
struct skb_info *tx_params;
struct ieee80211_hdr *tmp_hdr = NULL;
struct ieee80211_hdr *wlh = NULL;
struct ieee80211_vif *vif = adapter->vifs[0];
u8 q_num, tid = 0;
if ((!skb) || (!skb->len)) {
rsi_dbg(ERR_ZONE, "%s: Null skb/zero Length packet\n",
ven_rsi_dbg(ERR_ZONE, "%s: Null skb/zero Length packet\n",
__func__);
goto xmit_fail;
}
if (common->fsm_state != FSM_MAC_INIT_DONE) {
rsi_dbg(ERR_ZONE, "%s: FSM state not open\n", __func__);
ven_rsi_dbg(ERR_ZONE, "%s: FSM state not open\n", __func__);
goto xmit_fail;
}
info = IEEE80211_SKB_CB(skb);
tx_params = (struct skb_info *)info->driver_data;
tmp_hdr = (struct ieee80211_hdr *)&skb->data[0];
wlh = (struct ieee80211_hdr *)&skb->data[0];
if ((ieee80211_is_mgmt(tmp_hdr->frame_control)) ||
(ieee80211_is_ctl(tmp_hdr->frame_control)) ||
(ieee80211_is_qos_nullfunc(tmp_hdr->frame_control))) {
if ((ieee80211_is_mgmt(wlh->frame_control)) ||
(ieee80211_is_ctl(wlh->frame_control)) ||
(ieee80211_is_qos_nullfunc(wlh->frame_control))) {
q_num = MGMT_SOFT_Q;
skb->priority = q_num;
if (ieee80211_is_probe_req(tmp_hdr->frame_control)) {
rsi_dbg(MGMT_TX_ZONE, "%s: Probe Request\n", __func__);
if (is_broadcast_ether_addr(tmp_hdr->addr1)) {
rsi_dbg(INFO_ZONE, "%s: Probe request backup\n", __func__);
memcpy(common->bgscan_probe_req, skb->data, skb->len);
ven_rsi_dbg(INFO_ZONE, "Core: TX Dot11 Mgmt Pkt Type: %s\n",
dot11_pkt_type(wlh->frame_control));
if (ieee80211_is_probe_req(wlh->frame_control)) {
if ((is_broadcast_ether_addr(wlh->addr1)) &&
(skb->data[MIN_802_11_HDR_LEN + 1] == 0)) {
memcpy(common->bgscan_probe_req,
skb->data, skb->len);
common->bgscan_probe_req_len = skb->len;
}
} else if (ieee80211_is_auth(tmp_hdr->frame_control))
rsi_dbg(MGMT_TX_ZONE, "%s: Auth Request\n", __func__);
else if (ieee80211_is_assoc_req(tmp_hdr->frame_control))
rsi_dbg(MGMT_TX_ZONE, "%s: Assoc Request\n", __func__);
else
rsi_dbg(MGMT_TX_ZONE, "%s: pkt_type=%04x\n",
__func__, tmp_hdr->frame_control);
}
if (rsi_prepare_mgmt_desc(common, skb)) {
ven_rsi_dbg(ERR_ZONE, "Failed to prepeare desc\n");
goto xmit_fail;
}
} else {
rsi_dbg(DATA_TX_ZONE, "%s: Data Packet\n", __func__);
if (ieee80211_is_data_qos(tmp_hdr->frame_control)) {
tid = (skb->data[24] & IEEE80211_QOS_TID);
struct rsi_sta *sta = NULL;
ven_rsi_dbg(INFO_ZONE, "Core: TX Data Packet\n");
rsi_hex_dump(DATA_TX_ZONE, "TX Data Packet",
skb->data, skb->len);
if (ieee80211_is_data_qos(wlh->frame_control)) {
u8 *qos = ieee80211_get_qos_ctl(wlh);
tid = *qos & IEEE80211_QOS_CTL_TID_MASK;
skb->priority = TID_TO_WME_AC(tid);
if ((vif->type == NL80211_IFTYPE_AP) &&
(!is_broadcast_ether_addr(wlh->addr1)) &&
(!is_multicast_ether_addr(wlh->addr1))) {
sta = rsi_find_sta(common, wlh->addr1);
if (!sta)
goto xmit_fail;
}
} else {
tid = IEEE80211_NONQOS_TID;
skb->priority = BE_Q;
if ((!is_broadcast_ether_addr(wlh->addr1)) &&
(!is_multicast_ether_addr(wlh->addr1)) &&
(vif->type == NL80211_IFTYPE_AP)) {
sta = rsi_find_sta(common, wlh->addr1);
if (!sta)
goto xmit_fail;
}
}
q_num = skb->priority;
tx_params->tid = tid;
if (sta) {
wlh->seq_ctrl =
cpu_to_le16((sta->seq_no[skb->priority] << 4) &
IEEE80211_SCTL_SEQ);
sta->seq_no[skb->priority] =
(sta->seq_no[skb->priority] + 1) % IEEE80211_MAX_SN;
tx_params->sta_id = sta->sta_id;
} else {
if (vif->type == NL80211_IFTYPE_AP) {
wlh->seq_ctrl =
cpu_to_le16((common->bc_mc_seqno << 4) &
IEEE80211_SCTL_SEQ);
common->bc_mc_seqno =
(common->bc_mc_seqno + 1) % IEEE80211_MAX_SN;
}
tx_params->sta_id = 0;
}
#ifdef EAPOL_IN_MGMT_Q
if (skb->protocol == cpu_to_le16(ETH_P_PAE)) {
q_num = MGMT_SOFT_Q;
skb->priority = q_num;
}
#endif
if (rsi_prepare_data_desc(common, skb)) {
ven_rsi_dbg(ERR_ZONE, "Failed to prepare data desc\n");
goto xmit_fail;
}
}
if ((q_num != MGMT_SOFT_Q) &&
((skb_queue_len(&common->tx_queue[q_num]) + 1) >=
DATA_QUEUE_WATER_MARK)) {
rsi_dbg(ERR_ZONE, "%s: sw queue full\n", __func__);
ven_rsi_dbg(ERR_ZONE, "%s: sw queue full\n", __func__);
if (!ieee80211_queue_stopped(adapter->hw, WME_AC(q_num)))
ieee80211_stop_queue(adapter->hw, WME_AC(q_num));
rsi_set_event(&common->tx_thread.event);
......@@ -389,13 +503,13 @@ void rsi_core_xmit(struct rsi_common *common, struct sk_buff *skb)
}
rsi_core_queue_pkt(common, skb);
rsi_dbg(DATA_TX_ZONE, "%s: ===> Scheduling TX thead <===\n", __func__);
ven_rsi_dbg(DATA_TX_ZONE, "%s: ===> Scheduling TX thead <===\n", __func__);
rsi_set_event(&common->tx_thread.event);
return;
xmit_fail:
rsi_dbg(ERR_ZONE, "%s: Failed to queue packet\n", __func__);
ven_rsi_dbg(ERR_ZONE, "%s: Failed to queue packet\n", __func__);
/* Dropping pkt here */
ieee80211_free_txskb(common->priv->hw, skb);
}
......@@ -206,9 +206,9 @@ static int rsi_stats_open(struct inode *inode,
*/
static int rsi_debug_zone_read(struct seq_file *seq, void *data)
{
rsi_dbg(FSM_ZONE, "%x: rsi_enabled zone", rsi_zone_enabled);
ven_rsi_dbg(FSM_ZONE, "%x: rsi_enabled zone", ven_rsi_zone_enabled);
seq_printf(seq, "The zones available are %#x\n",
rsi_zone_enabled);
ven_rsi_zone_enabled);
return 0;
}
......@@ -252,7 +252,7 @@ static ssize_t rsi_debug_zone_write(struct file *filp,
if (ret)
return ret;
rsi_zone_enabled = dbg_zone;
ven_rsi_zone_enabled = dbg_zone;
return len;
}
......@@ -280,8 +280,13 @@ static int rsi_bgscan_int_read(struct seq_file *file, void *data)
params->two_probe,
params->num_bg_channels);
for (cnt = 0; cnt < params->num_bg_channels; cnt++)
for (cnt = 0; cnt < params->num_bg_channels; cnt++) {
if (params->channels2scan[cnt] & (BIT(15)))
seq_printf(file, "%d[DFS] ",
(params->channels2scan[cnt] & 0x7FFF));
else
seq_printf(file, "%d ", params->channels2scan[cnt]);
}
seq_printf(file, "\n");
return 0;
......@@ -334,20 +339,26 @@ static ssize_t rsi_bgscan_write(struct file *file,
if (!g_bgscan_enable) {
/* return here if bgscan is already disabled */
if (!common->bgscan_en) {
rsi_dbg(ERR_ZONE, "bgscan already disabled\n");
#ifdef PLATFORM_X86
ven_rsi_dbg(ERR_ZONE, "bgscan already disabled\n");
#endif
return total_bytes;
}
mutex_lock(&common->mutex);
if (bss->assoc && !rsi_send_bgscan_params(common, 0)) {
rsi_dbg(ERR_ZONE, "*** bgscan disabled ***\n");
#ifdef PLATFORM_X86
ven_rsi_dbg(ERR_ZONE, "*** bgscan disabled ***\n");
#endif
common->bgscan_en = 0;
}
mutex_unlock(&common->mutex);
return total_bytes;
} else if (common->bgscan_en) {
rsi_dbg(ERR_ZONE, "bgscan already enabled\n");
#ifdef PLATFORM_X86
ven_rsi_dbg(ERR_ZONE, "bgscan already enabled\n");
#endif
return total_bytes;
}
......@@ -373,29 +384,39 @@ static ssize_t rsi_bgscan_write(struct file *file,
common->bgscan_info.active_scan_duration = bgscan_vals[3];
common->bgscan_info.passive_scan_duration = bgscan_vals[4];
common->bgscan_info.two_probe = bgscan_vals[5];
common->bgscan_info.num_bg_channels = bgscan_vals[6];
for (cnt = 0; cnt < common->bgscan_info.num_bg_channels; cnt++)
common->bgscan_info.channels2scan[cnt] = bgscan_vals[7 + cnt];
rsi_dbg(INFO_ZONE,
common->bgscan_info.num_user_channels = bgscan_vals[6];
memset(&common->bgscan_info.user_channels, 0,
(MAX_BGSCAN_CHANNELS * 2));
common->bgscan_info.num_user_channels =
((bgscan_vals[6] > MAX_BGSCAN_CHANNELS) ?
MAX_BGSCAN_CHANNELS : bgscan_vals[6]);
for (cnt = 0; cnt < common->bgscan_info.num_user_channels; cnt++)
common->bgscan_info.user_channels[cnt] = bgscan_vals[7 + cnt];
#ifdef PLATFORM_X86
ven_rsi_dbg(INFO_ZONE,
"bgscan_count = %d, roam_count = %d, periodicity = %d\n",
common->bgscan_info.bgscan_threshold,
common->bgscan_info.roam_threshold,
common->bgscan_info.bgscan_periodicity);
rsi_dbg(INFO_ZONE,
ven_rsi_dbg(INFO_ZONE,
"active_scan_dur = %d, passive_scan_dur = %d, two_probe = %d\n",
common->bgscan_info.active_scan_duration,
common->bgscan_info.passive_scan_duration,
common->bgscan_info.two_probe);
rsi_dbg(INFO_ZONE, "Number of scan channels = %d\n",
common->bgscan_info.num_bg_channels);
ven_rsi_dbg(INFO_ZONE, "Number of scan channels = %d\n",
common->bgscan_info.num_user_channels);
rsi_hex_dump(INFO_ZONE, "bgscan channels",
(u8 *)common->bgscan_info.channels2scan,
common->bgscan_info.num_bg_channels * 2);
(u8 *)common->bgscan_info.user_channels,
common->bgscan_info.num_user_channels * 2);
#endif
/* If connection is not done don't send bgscan params */
if (!bss->assoc) {
rsi_dbg(INFO_ZONE, "Station not connected; skip now\n");
#ifdef PLATFORM_X86
ven_rsi_dbg(INFO_ZONE, "Station not connected; skip now\n");
#endif
return total_bytes;
}
......@@ -403,15 +424,23 @@ static ssize_t rsi_bgscan_write(struct file *file,
mutex_lock(&common->mutex);
if (!rsi_send_bgscan_params(common, 1)) {
if (!rsi_send_bgscan_probe_req(common)) {
rsi_dbg(INFO_ZONE, "Background scan started ===>\n");
#ifdef PLATFORM_X86
ven_rsi_dbg(INFO_ZONE, "Background scan started ===>\n");
#endif
common->bgscan_en = 1;
} else {
rsi_dbg(ERR_ZONE, "Failed sending bgscan probe req\n");
#ifdef PLATFORM_X86
ven_rsi_dbg(ERR_ZONE, "Failed sending bgscan probe req\n");
#endif
common->bgscan_en = 0;
g_bgscan_enable = 0;
}
} else
rsi_dbg(ERR_ZONE, "Failed sending bgscan params req\n");
} else {
#ifdef PLATFORM_X86
ven_rsi_dbg(ERR_ZONE, "Failed sending bgscan params req\n");
#endif
}
mutex_unlock(&common->mutex);
return total_bytes;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -21,14 +21,14 @@
#include "rsi_mgmt.h"
#include "rsi_common.h"
#include "rsi_hal.h"
#ifdef CONFIG_VEN_RSI_HCI
#if defined(CONFIG_VEN_RSI_HCI) || defined(CONFIG_VEN_RSI_COEX)
#include "rsi_hci.h"
#endif
#ifdef CONFIG_VEN_RSI_COEX
#include "rsi_coex.h"
#endif
u32 rsi_zone_enabled = //INFO_ZONE |
u32 ven_rsi_zone_enabled = //INFO_ZONE |
INIT_ZONE |
//MGMT_TX_ZONE |
//MGMT_RX_ZONE |
......@@ -38,16 +38,16 @@ u32 rsi_zone_enabled = //INFO_ZONE |
//ISR_ZONE |
ERR_ZONE |
0;
EXPORT_SYMBOL_GPL(rsi_zone_enabled);
EXPORT_SYMBOL_GPL(ven_rsi_zone_enabled);
/**
* rsi_dbg() - This function outputs informational messages.
* ven_rsi_dbg() - This function outputs informational messages.
* @zone: Zone of interest for output message.
* @fmt: printf-style format for output message.
*
* Return: none
*/
void rsi_dbg(u32 zone, const char *fmt, ...)
void ven_rsi_dbg(u32 zone, const char *fmt, ...)
{
struct va_format vaf;
va_list args;
......@@ -57,11 +57,11 @@ void rsi_dbg(u32 zone, const char *fmt, ...)
vaf.fmt = fmt;
vaf.va = &args;
if (zone & rsi_zone_enabled)
if (zone & ven_rsi_zone_enabled)
pr_info("%pV", &vaf);
va_end(args);
}
EXPORT_SYMBOL_GPL(rsi_dbg);
EXPORT_SYMBOL_GPL(ven_rsi_dbg);
/**
* rsi_hex_dump() - This function prints the packet (/msg) in hex bytes.
......@@ -76,7 +76,7 @@ void rsi_hex_dump(u32 zone, char *msg_str, const u8 *msg, u32 len)
{
int ii;
if (!(zone & rsi_zone_enabled))
if (!(zone & ven_rsi_zone_enabled))
return;
printk("%s: (length = %d)\n", msg_str, len);
for (ii = 0; ii < len; ii++) {
......@@ -111,7 +111,7 @@ static struct sk_buff *rsi_prepare_skb(struct rsi_common *common,
return NULL;
if (pkt_len > (RSI_RCV_BUFFER_LEN * 4)) {
rsi_dbg(ERR_ZONE, "%s: Pkt size > max rx buf size %d\n",
ven_rsi_dbg(ERR_ZONE, "%s: Pkt size > max rx buf size %d\n",
__func__, pkt_len);
pkt_len = RSI_RCV_BUFFER_LEN * 4;
}
......@@ -128,19 +128,23 @@ static struct sk_buff *rsi_prepare_skb(struct rsi_common *common,
info = IEEE80211_SKB_CB(skb);
rx_params = (struct skb_info *)info->driver_data;
rx_params->rssi = rsi_get_rssi(buffer);
// if (vif->type == NL80211_IFTYPE_STATION)
rx_params->channel = rsi_get_connected_channel(common->priv);
// else
// rx_params->channel = common->ap_channel->hw_value;
return skb;
}
/**
* rsi_read_pkt() - This function reads frames from the card.
* ven_rsi_read_pkt() - This function reads frames from the card.
* @common: Pointer to the driver private structure.
* @rcv_pkt_len: Received pkt length. In case of USB it is 0.
*
* Return: 0 on success, -1 on failure.
*/
int rsi_read_pkt(struct rsi_common *common, u8 *rx_pkt, s32 rcv_pkt_len)
int ven_rsi_read_pkt(struct rsi_common *common, u8 *rx_pkt, s32 rcv_pkt_len)
{
u8 *frame_desc = NULL, extended_desc = 0;
u32 index = 0, length = 0, queueno = 0;
......@@ -153,7 +157,7 @@ int rsi_read_pkt(struct rsi_common *common, u8 *rx_pkt, s32 rcv_pkt_len)
offset = *(u16 *)&frame_desc[2];
if ((actual_length < (4 + FRAME_DESC_SZ)) || (offset < 4)) {
rsi_dbg(ERR_ZONE,
ven_rsi_dbg(ERR_ZONE,
"%s: actual_length (%d) is less than 20 or"
" offset(%d) is less than 4\n",
__func__, actual_length, offset);
......@@ -168,10 +172,14 @@ int rsi_read_pkt(struct rsi_common *common, u8 *rx_pkt, s32 rcv_pkt_len)
switch (queueno) {
case RSI_COEX_Q:
rsi_hex_dump(MGMT_RX_ZONE,
"RX Command packet",
"RX Command co ex packet",
frame_desc + offset,
FRAME_DESC_SZ + length);
#ifdef CONFIG_VEN_RSI_COEX
rsi_coex_recv_pkt(common, (frame_desc + offset));
#else
rsi_mgmt_pkt_recv(common, (frame_desc + offset));
#endif
break;
case RSI_WIFI_DATA_Q:
rsi_hex_dump(DATA_RX_ZONE,
......@@ -191,7 +199,7 @@ int rsi_read_pkt(struct rsi_common *common, u8 *rx_pkt, s32 rcv_pkt_len)
case RSI_WIFI_MGMT_Q:
rsi_mgmt_pkt_recv(common, (frame_desc + offset));
break;
#ifdef CONFIG_VEN_RSI_HCI
#if defined(CONFIG_VEN_RSI_HCI) || defined(CONFIG_VEN_RSI_COEX)
case RSI_BT_MGMT_Q:
case RSI_BT_DATA_Q:
rsi_hex_dump(DATA_RX_ZONE,
......@@ -203,7 +211,7 @@ int rsi_read_pkt(struct rsi_common *common, u8 *rx_pkt, s32 rcv_pkt_len)
#endif
default:
rsi_dbg(ERR_ZONE, "%s: pkt from invalid queue: %d\n",
ven_rsi_dbg(ERR_ZONE, "%s: pkt from invalid queue: %d\n",
__func__, queueno);
goto fail;
}
......@@ -216,7 +224,7 @@ int rsi_read_pkt(struct rsi_common *common, u8 *rx_pkt, s32 rcv_pkt_len)
fail:
return -EINVAL;
}
EXPORT_SYMBOL_GPL(rsi_read_pkt);
EXPORT_SYMBOL_GPL(ven_rsi_read_pkt);
/**
* rsi_tx_scheduler_thread() - This function is a kernel thread to send the
......@@ -243,12 +251,12 @@ static void rsi_tx_scheduler_thread(struct rsi_common *common)
}
/**
* rsi_91x_init() - This function initializes os interface operations.
* ven_rsi_91x_init() - This function initializes os interface operations.
* @void: Void.
*
* Return: Pointer to the adapter structure on success, NULL on failure .
*/
struct rsi_hw *rsi_91x_init(void)
struct rsi_hw *ven_rsi_91x_init(void)
{
struct rsi_hw *adapter = NULL;
struct rsi_common *common = NULL;
......@@ -260,7 +268,7 @@ struct rsi_hw *rsi_91x_init(void)
adapter->priv = kzalloc(sizeof(*common), GFP_KERNEL);
if (!adapter->priv) {
rsi_dbg(ERR_ZONE, "%s: Failed in allocation of priv\n",
ven_rsi_dbg(ERR_ZONE, "%s: Failed in allocation of priv\n",
__func__);
kfree(adapter);
return NULL;
......@@ -268,6 +276,11 @@ struct rsi_hw *rsi_91x_init(void)
common = adapter->priv;
common->priv = adapter;
common->beacon_frame = kzalloc(512, GFP_KERNEL);
if (!common->beacon_frame)
goto err;
common->beacon_frame_len = 0;
for (ii = 0; ii < NUM_SOFT_QUEUES; ii++)
skb_queue_head_init(&common->tx_queue[ii]);
......@@ -280,9 +293,16 @@ struct rsi_hw *rsi_91x_init(void)
&common->tx_thread,
rsi_tx_scheduler_thread,
"Tx-Thread")) {
rsi_dbg(ERR_ZONE, "%s: Unable to init tx thrd\n", __func__);
ven_rsi_dbg(ERR_ZONE, "%s: Unable to init tx thrd\n", __func__);
goto err;
}
#ifdef CONFIG_VEN_RSI_COEX
if (rsi_coex_init(common)) {
ven_rsi_dbg(ERR_ZONE, "Failed to init COEX module\n");
goto err;
}
#endif
rsi_default_ps_params(adapter);
spin_lock_init(&adapter->ps_lock);
common->uapsd_bitmap = 0;
......@@ -296,33 +316,36 @@ struct rsi_hw *rsi_91x_init(void)
kfree(adapter);
return NULL;
}
EXPORT_SYMBOL_GPL(rsi_91x_init);
EXPORT_SYMBOL_GPL(ven_rsi_91x_init);
/**
* rsi_91x_deinit() - This function de-intializes os intf operations.
* ven_rsi_91x_deinit() - This function de-intializes os intf operations.
* @adapter: Pointer to the adapter structure.
*
* Return: None.
*/
void rsi_91x_deinit(struct rsi_hw *adapter)
void ven_rsi_91x_deinit(struct rsi_hw *adapter)
{
struct rsi_common *common = adapter->priv;
u8 ii;
rsi_dbg(INFO_ZONE, "%s: Deinit core module...\n", __func__);
ven_rsi_dbg(INFO_ZONE, "%s: Deinit core module...\n", __func__);
rsi_kill_thread(&common->tx_thread);
for (ii = 0; ii < NUM_SOFT_QUEUES; ii++)
skb_queue_purge(&common->tx_queue[ii]);
#ifdef CONFIG_VEN_RSI_COEX
rsi_coex_deinit(common);
#endif
common->init_done = false;
kfree(common);
kfree(adapter->rsi_dev);
kfree(adapter);
}
EXPORT_SYMBOL_GPL(rsi_91x_deinit);
EXPORT_SYMBOL_GPL(ven_rsi_91x_deinit);
/**
* rsi_91x_hal_module_init() - This function is invoked when the module is
......@@ -334,7 +357,7 @@ EXPORT_SYMBOL_GPL(rsi_91x_deinit);
*/
static int rsi_91x_hal_module_init(void)
{
rsi_dbg(INIT_ZONE, "%s: Module init called\n", __func__);
ven_rsi_dbg(INIT_ZONE, "%s: Module init called\n", __func__);
return 0;
}
......@@ -348,7 +371,7 @@ static int rsi_91x_hal_module_init(void)
*/
static void rsi_91x_hal_module_exit(void)
{
rsi_dbg(INIT_ZONE, "%s: Module exit called\n", __func__);
ven_rsi_dbg(INIT_ZONE, "%s: Module exit called\n", __func__);
}
module_init(rsi_91x_hal_module_init);
......
This diff is collapsed.
......@@ -57,7 +57,7 @@ char *str_psstate(enum ps_state state)
static inline void rsi_modify_ps_state(struct rsi_hw *adapter,
enum ps_state nstate)
{
rsi_dbg(INFO_ZONE, "PS state changed %s => %s\n",
ven_rsi_dbg(INFO_ZONE, "PS state changed %s => %s\n",
str_psstate(adapter->ps_state),
str_psstate(nstate));
......@@ -100,14 +100,14 @@ EXPORT_SYMBOL_GPL(rsi_default_ps_params);
void rsi_enable_ps(struct rsi_hw *adapter)
{
if (adapter->ps_state != PS_NONE) {
rsi_dbg(ERR_ZONE,
ven_rsi_dbg(ERR_ZONE,
"%s: Cannot accept enable PS in %s state\n",
__func__, str_psstate(adapter->ps_state));
return;
}
if (rsi_send_ps_request(adapter, true)) {
rsi_dbg(ERR_ZONE,
ven_rsi_dbg(ERR_ZONE,
"%s: Failed to send PS request to device\n",
__func__);
return;
......@@ -126,14 +126,14 @@ void rsi_enable_ps(struct rsi_hw *adapter)
void rsi_disable_ps(struct rsi_hw *adapter)
{
if (adapter->ps_state != PS_ENABLED) {
rsi_dbg(ERR_ZONE,
ven_rsi_dbg(ERR_ZONE,
"%s: Cannot accept disable PS in %s state\n",
__func__, str_psstate(adapter->ps_state));
return;
}
if (rsi_send_ps_request(adapter, false)) {
rsi_dbg(ERR_ZONE,
ven_rsi_dbg(ERR_ZONE,
"%s: Failed to send PS request to device\n",
__func__);
return;
......@@ -155,14 +155,14 @@ void rsi_conf_uapsd(struct rsi_hw *adapter)
return;
if (rsi_send_ps_request(adapter, false)) {
rsi_dbg(ERR_ZONE,
ven_rsi_dbg(ERR_ZONE,
"%s: Failed to send PS request to device\n",
__func__);
return;
}
if (rsi_send_ps_request(adapter, true)) {
rsi_dbg(ERR_ZONE,
ven_rsi_dbg(ERR_ZONE,
"%s: Failed to send PS request to device\n",
__func__);
}
......@@ -192,7 +192,7 @@ int rsi_handle_ps_confirm(struct rsi_hw *adapter, u8 *msg)
rsi_modify_ps_state(adapter, PS_NONE);
break;
default:
rsi_dbg(ERR_ZONE,
ven_rsi_dbg(ERR_ZONE,
"Invalid PS confirm type %x in state %s\n",
cfm_type, str_psstate(adapter->ps_state));
return -1;
......
This diff is collapsed.
......@@ -37,7 +37,7 @@ int rsi_sdio_master_access_msword(struct rsi_hw *adapter,
byte = (u8)(ms_word & 0x00FF);
rsi_dbg(INFO_ZONE,
ven_rsi_dbg(INFO_ZONE,
"%s: MASTER_ACCESS_MSBYTE:0x%x\n", __func__, byte);
status = rsi_sdio_write_register(adapter,
......@@ -45,7 +45,7 @@ int rsi_sdio_master_access_msword(struct rsi_hw *adapter,
SDIO_MASTER_ACCESS_MSBYTE,
&byte);
if (status) {
rsi_dbg(ERR_ZONE,
ven_rsi_dbg(ERR_ZONE,
"%s: fail to access MASTER_ACCESS_MSBYTE\n",
__func__);
return -1;
......@@ -53,7 +53,7 @@ int rsi_sdio_master_access_msword(struct rsi_hw *adapter,
byte = (u8)(ms_word >> 8);
rsi_dbg(INFO_ZONE, "%s:MASTER_ACCESS_LSBYTE:0x%x\n", __func__, byte);
ven_rsi_dbg(INFO_ZONE, "%s:MASTER_ACCESS_LSBYTE:0x%x\n", __func__, byte);
status = rsi_sdio_write_register(adapter,
function,
SDIO_MASTER_ACCESS_LSBYTE,
......@@ -91,7 +91,7 @@ static int rsi_process_pkt(struct rsi_common *common)
SDIO_RX_NUM_BLOCKS_REG,
&value);
if (status) {
rsi_dbg(ERR_ZONE,
ven_rsi_dbg(ERR_ZONE,
"%s: Failed to read pkt length from the card:\n",
__func__);
return status;
......@@ -118,7 +118,7 @@ static int rsi_process_pkt(struct rsi_common *common)
common->rx_data_pkt = kmalloc(rcv_pkt_len, GFP_KERNEL);
if (!common->rx_data_pkt) {
rsi_dbg(ERR_ZONE, "%s: Failed in memory allocation\n",
ven_rsi_dbg(ERR_ZONE, "%s: Failed in memory allocation\n",
__func__);
return -ENOMEM;
}
......@@ -127,12 +127,12 @@ static int rsi_process_pkt(struct rsi_common *common)
common->rx_data_pkt,
rcv_pkt_len);
if (status) {
rsi_dbg(ERR_ZONE, "%s: Failed to read packet from card\n",
ven_rsi_dbg(ERR_ZONE, "%s: Failed to read packet from card\n",
__func__);
goto fail;
}
status = rsi_read_pkt(common, common->rx_data_pkt, rcv_pkt_len);
status = ven_rsi_read_pkt(common, common->rx_data_pkt, rcv_pkt_len);
fail:
kfree(common->rx_data_pkt);
......@@ -161,7 +161,7 @@ int rsi_init_sdio_slave_regs(struct rsi_hw *adapter)
SDIO_NXT_RD_DELAY2,
&byte);
if (status) {
rsi_dbg(ERR_ZONE,
ven_rsi_dbg(ERR_ZONE,
"%s: Failed to write SDIO_NXT_RD_DELAY2\n",
__func__);
return -1;
......@@ -169,7 +169,7 @@ int rsi_init_sdio_slave_regs(struct rsi_hw *adapter)
}
if (dev->sdio_high_speed_enable) {
rsi_dbg(INIT_ZONE, "%s: Enabling SDIO High speed\n", __func__);
ven_rsi_dbg(INIT_ZONE, "%s: Enabling SDIO High speed\n", __func__);
byte = 0x3;
status = rsi_sdio_write_register(adapter,
......@@ -177,7 +177,7 @@ int rsi_init_sdio_slave_regs(struct rsi_hw *adapter)
SDIO_REG_HIGH_SPEED,
&byte);
if (status) {
rsi_dbg(ERR_ZONE,
ven_rsi_dbg(ERR_ZONE,
"%s: Failed to enable SDIO high speed\n",
__func__);
return -1;
......@@ -185,7 +185,7 @@ int rsi_init_sdio_slave_regs(struct rsi_hw *adapter)
}
/* This tells SDIO FIFO when to start read to host */
rsi_dbg(INIT_ZONE, "%s: Initialzing SDIO read start level\n", __func__);
ven_rsi_dbg(INIT_ZONE, "%s: Initialzing SDIO read start level\n", __func__);
byte = 0x24;
status = rsi_sdio_write_register(adapter,
......@@ -193,12 +193,12 @@ int rsi_init_sdio_slave_regs(struct rsi_hw *adapter)
SDIO_READ_START_LVL,
&byte);
if (status) {
rsi_dbg(ERR_ZONE,
ven_rsi_dbg(ERR_ZONE,
"%s: Failed to write SDIO_READ_START_LVL\n", __func__);
return -1;
}
rsi_dbg(INIT_ZONE, "%s: Initialzing FIFO ctrl registers\n", __func__);
ven_rsi_dbg(INIT_ZONE, "%s: Initialzing FIFO ctrl registers\n", __func__);
byte = (128 - 32);
status = rsi_sdio_write_register(adapter,
......@@ -206,7 +206,7 @@ int rsi_init_sdio_slave_regs(struct rsi_hw *adapter)
SDIO_READ_FIFO_CTL,
&byte);
if (status) {
rsi_dbg(ERR_ZONE,
ven_rsi_dbg(ERR_ZONE,
"%s: Failed to write SDIO_READ_FIFO_CTL\n", __func__);
return -1;
}
......@@ -217,7 +217,7 @@ int rsi_init_sdio_slave_regs(struct rsi_hw *adapter)
SDIO_WRITE_FIFO_CTL,
&byte);
if (status) {
rsi_dbg(ERR_ZONE,
ven_rsi_dbg(ERR_ZONE,
"%s: Failed to write SDIO_WRITE_FIFO_CTL\n", __func__);
return -1;
}
......@@ -225,6 +225,22 @@ int rsi_init_sdio_slave_regs(struct rsi_hw *adapter)
return 0;
}
int rsi_read_intr_status_reg(struct rsi_hw *adapter)
{
u8 isr_status = 0;
struct rsi_common *common = adapter->priv;
int status;
status = rsi_sdio_read_register(common->priv,
RSI_FN1_INT_REGISTER,
&isr_status);
isr_status &= 0xE;
if(isr_status & BIT(MSDU_PKT_PENDING))
adapter->isr_pending = 1;
return 0;
}
/**
* rsi_interrupt_handler() - This function read and process SDIO interrupts.
* @adapter: Pointer to the adapter structure.
......@@ -249,7 +265,7 @@ void rsi_interrupt_handler(struct rsi_hw *adapter)
RSI_FN1_INT_REGISTER,
&isr_status);
if (status) {
rsi_dbg(ERR_ZONE,
ven_rsi_dbg(ERR_ZONE,
"%s: Failed to Read Intr Status Register\n",
__func__);
mutex_unlock(&common->rx_lock);
......@@ -269,7 +285,7 @@ void rsi_interrupt_handler(struct rsi_hw *adapter)
// adapter->interrupt_status = isr_status;
// isr_status &= 0xE;
rsi_dbg(ISR_ZONE, "%s: Intr_status = %x %d %d\n",
ven_rsi_dbg(ISR_ZONE, "%s: Intr_status = %x %d %d\n",
__func__, isr_status, (1 << MSDU_PKT_PENDING),
(1 << FW_ASSERT_IND));
......@@ -286,25 +302,26 @@ void rsi_interrupt_handler(struct rsi_hw *adapter)
(1 << PKT_BUFF_AVAILABLE));
rsi_set_event(&common->tx_thread.event);
rsi_dbg(ISR_ZONE,
ven_rsi_dbg(ISR_ZONE,
"%s: ==> BUFFER_AVAILABLE <==\n",
__func__);
dev->rx_info.buf_available_counter++;
dev->buff_status_updated = 1;
break;
case FIRMWARE_ASSERT_IND:
rsi_dbg(ERR_ZONE,
ven_rsi_dbg(ERR_ZONE,
"%s: ==> FIRMWARE Assert <==\n",
__func__);
status = rsi_sdio_read_register(common->priv,
SDIO_FW_STATUS_REG,
&fw_status);
if (status) {
rsi_dbg(ERR_ZONE,
ven_rsi_dbg(ERR_ZONE,
"%s: Failed to read f/w reg\n",
__func__);
} else {
rsi_dbg(ERR_ZONE,
ven_rsi_dbg(ERR_ZONE,
"%s: Firmware Status is 0x%x\n",
__func__, fw_status);
rsi_sdio_ack_intr(common->priv,
......@@ -315,12 +332,12 @@ void rsi_interrupt_handler(struct rsi_hw *adapter)
break;
case MSDU_PACKET_PENDING:
rsi_dbg(ISR_ZONE, "Pkt pending interrupt\n");
ven_rsi_dbg(ISR_ZONE, "Pkt pending interrupt\n");
dev->rx_info.total_sdio_msdu_pending_intr++;
status = rsi_process_pkt(common);
if (status) {
rsi_dbg(ERR_ZONE,
ven_rsi_dbg(ERR_ZONE,
"%s: Failed to read pkt\n",
__func__);
mutex_unlock(&common->rx_lock);
......@@ -331,7 +348,7 @@ void rsi_interrupt_handler(struct rsi_hw *adapter)
rsi_sdio_ack_intr(common->priv, isr_status);
dev->rx_info.total_sdio_unknown_intr++;
isr_status = 0;
rsi_dbg(ISR_ZONE,
ven_rsi_dbg(ISR_ZONE,
"Unknown Interrupt %x\n",
isr_status);
break;
......@@ -359,13 +376,22 @@ int rsi_sdio_read_buffer_status_register(struct rsi_hw *adapter, u8 q_num)
(struct rsi_91x_sdiodev *)adapter->rsi_dev;
u8 buf_status = 0;
int status = 0;
#if 0
static int counter = 4;
if ((!dev->buff_status_updated) && counter) {
counter--;
goto out;
}
#endif
dev->buff_status_updated = 0;
status = rsi_sdio_read_register(common->priv,
RSI_DEVICE_BUFFER_STATUS_REGISTER,
&buf_status);
if (status) {
rsi_dbg(ERR_ZONE,
ven_rsi_dbg(ERR_ZONE,
"%s: Failed to read status register\n", __func__);
return -1;
}
......@@ -393,7 +419,9 @@ int rsi_sdio_read_buffer_status_register(struct rsi_hw *adapter, u8 q_num)
} else {
dev->rx_info.semi_buffer_full = false;
}
// (dev->rx_info.semi_buffer_full ? (counter = 4) : (counter = 1));
out:
if ((q_num == MGMT_SOFT_Q) && (dev->rx_info.mgmt_buffer_full))
return QUEUE_FULL;
......
......@@ -64,12 +64,12 @@ static int rsi_usb_card_write(struct rsi_hw *adapter,
&transfer,
HZ * 5);
if (status < 0) {
rsi_dbg(ERR_ZONE,
ven_rsi_dbg(ERR_ZONE,
"Card write failed with error code :%d\n", status);
dev->write_fail = 1;
goto fail;
}
rsi_dbg(MGMT_TX_ZONE, "%s: Sent Message successfully\n", __func__);
ven_rsi_dbg(MGMT_TX_ZONE, "%s: Sent Message successfully\n", __func__);
fail:
return status;
......@@ -94,7 +94,7 @@ static int rsi_write_multiple(struct rsi_hw *adapter,
(struct rsi_91x_usbdev *)adapter->rsi_dev;
if (!adapter || addr == 0) {
rsi_dbg(INFO_ZONE,
ven_rsi_dbg(INFO_ZONE,
"%s: Unable to write to card\n", __func__);
return -1;
}
......@@ -141,7 +141,7 @@ static int rsi_usb_reg_read(struct usb_device *usbdev,
*value = (buf[0] | (buf[1] << 8));
if (status < 0) {
rsi_dbg(ERR_ZONE,
ven_rsi_dbg(ERR_ZONE,
"%s: Reg read failed with error code :%d\n",
__func__, status);
}
......@@ -185,7 +185,7 @@ static int rsi_usb_reg_write(struct usb_device *usbdev,
len,
USB_CTRL_SET_TIMEOUT);
if (status < 0) {
rsi_dbg(ERR_ZONE,
ven_rsi_dbg(ERR_ZONE,
"%s: Reg write failed with error code :%d\n",
__func__, status);
}
......@@ -235,7 +235,7 @@ int rsi_usb_read_register_multiple(struct rsi_hw *adapter,
transfer,
USB_CTRL_GET_TIMEOUT);
if (status < 0) {
rsi_dbg(ERR_ZONE,
ven_rsi_dbg(ERR_ZONE,
"Reg read failed with error code :%d\n",
status);
kfree(buf);
......@@ -293,7 +293,7 @@ int rsi_usb_write_register_multiple(struct rsi_hw *adapter,
transfer,
USB_CTRL_SET_TIMEOUT);
if (status < 0) {
rsi_dbg(ERR_ZONE,
ven_rsi_dbg(ERR_ZONE,
"Reg write failed with error code :%d\n",
status);
kfree(buf);
......@@ -324,7 +324,7 @@ static void rsi_rx_done_handler(struct urb *urb)
return;
if (urb->actual_length <= 0) {
rsi_dbg(INFO_ZONE, "%s: Zero length packet\n", __func__);
ven_rsi_dbg(INFO_ZONE, "%s: Zero length packet\n", __func__);
return;
}
rx_cb->pend = 1;
......@@ -356,7 +356,7 @@ static int rsi_rx_urb_submit(struct rsi_hw *adapter, u8 ep_num)
status = usb_submit_urb(urb, GFP_KERNEL);
if (status)
rsi_dbg(ERR_ZONE, "%s: Failed in urb submission\n", __func__);
ven_rsi_dbg(ERR_ZONE, "%s: Failed in urb submission\n", __func__);
return status;
}
......@@ -377,7 +377,7 @@ int rsi_usb_host_intf_write_pkt(struct rsi_hw *adapter,
u32 queueno = ((pkt[1] >> 4) & 0x7);
u8 endpoint;
rsi_dbg(DATA_TX_ZONE, "%s: queueno=%d\n", __func__, queueno);
ven_rsi_dbg(DATA_TX_ZONE, "%s: queueno=%d\n", __func__, queueno);
endpoint = ((queueno == RSI_WIFI_MGMT_Q || queueno == RSI_COEX_Q ||
queueno == RSI_WIFI_DATA_Q) ?
MGMT_EP : DATA_EP);
......@@ -421,7 +421,7 @@ int rsi_usb_load_data_master_write(struct rsi_hw *adapter,
u8 temp_buf[256];
num_blocks = instructions_sz / block_size;
rsi_dbg(INFO_ZONE, "num_blocks: %d\n", num_blocks);
ven_rsi_dbg(INFO_ZONE, "num_blocks: %d\n", num_blocks);
for (cur_indx = 0, ii = 0;
ii < num_blocks;
......@@ -434,7 +434,7 @@ int rsi_usb_load_data_master_write(struct rsi_hw *adapter,
block_size)) < 0)
return -1;
rsi_dbg(INFO_ZONE, "%s: loading block: %d\n", __func__, ii);
ven_rsi_dbg(INFO_ZONE, "%s: loading block: %d\n", __func__, ii);
base_address += block_size;
}
......@@ -447,7 +447,7 @@ int rsi_usb_load_data_master_write(struct rsi_hw *adapter,
(u8 *)temp_buf,
instructions_sz % block_size)) < 0)
return -1;
rsi_dbg(INFO_ZONE,
ven_rsi_dbg(INFO_ZONE,
"Written Last Block in Address 0x%x Successfully\n",
cur_indx);
}
......@@ -464,12 +464,12 @@ static void rsi_deinit_usb_interface(struct rsi_hw *adapter)
{
struct rsi_91x_usbdev *dev = (struct rsi_91x_usbdev *)adapter->rsi_dev;
rsi_dbg(INFO_ZONE, "Deinitializing USB interface...\n");
ven_rsi_dbg(INFO_ZONE, "Deinitializing USB interface...\n");
rsi_kill_thread(&dev->rx_thread);
kfree(dev->rx_cb[0].rx_buffer);
usb_free_urb(dev->rx_cb[0].rx_urb);
#ifdef CONFIG_VEN_RSI_HCI
#if defined (CONFIG_VEN_RSI_HCI) || defined(CONFIG_VEN_RSI_COEX)
kfree(dev->rx_cb[1].rx_buffer);
usb_free_urb(dev->rx_cb[1].rx_urb);
#endif
......@@ -556,7 +556,7 @@ static int rsi_usb_init_rx(struct rsi_hw *adapter)
rx_cb->rx_urb = usb_alloc_urb(0, GFP_KERNEL);
if (!rx_cb->rx_urb) {
rsi_dbg(ERR_ZONE, "Failed alloc rx urb[%d]\n", idx);
ven_rsi_dbg(ERR_ZONE, "Failed alloc rx urb[%d]\n", idx);
goto err;
}
rx_cb->rx_urb->transfer_buffer = rx_cb->rx_buffer;
......@@ -614,7 +614,7 @@ static int rsi_init_usb_interface(struct rsi_hw *adapter,
/* Initialize RX handle */
if (rsi_usb_init_rx(adapter)) {
rsi_dbg(ERR_ZONE, "Failed to init RX handle\n");
ven_rsi_dbg(ERR_ZONE, "Failed to init RX handle\n");
goto fail_1;
}
......@@ -632,7 +632,7 @@ static int rsi_init_usb_interface(struct rsi_hw *adapter,
status = rsi_create_kthread(common, &rsi_dev->rx_thread,
rsi_usb_rx_thread, "RX-Thread");
if (status) {
rsi_dbg(ERR_ZONE, "%s: Unable to init rx thrd\n", __func__);
ven_rsi_dbg(ERR_ZONE, "%s: Unable to init rx thrd\n", __func__);
goto fail_2;
}
......@@ -642,7 +642,7 @@ static int rsi_init_usb_interface(struct rsi_hw *adapter,
adapter->num_debugfs_entries = MAX_DEBUGFS_ENTRIES - 1;
#endif
rsi_dbg(INIT_ZONE, "%s: Enabled the interface\n", __func__);
ven_rsi_dbg(INIT_ZONE, "%s: Enabled the interface\n", __func__);
return 0;
fail_2:
......@@ -710,7 +710,7 @@ static int rsi_reset_card(struct rsi_hw *adapter)
{
u16 temp[4] = {0};
rsi_dbg(INFO_ZONE, "Resetting Card...\n");
ven_rsi_dbg(INFO_ZONE, "Resetting Card...\n");
#define TA_HOLD_REG 0x22000844
rsi_usb_master_reg_write(adapter, TA_HOLD_REG, 0xE, 4);
......@@ -749,11 +749,11 @@ static int rsi_reset_card(struct rsi_hw *adapter)
temp, 32)) < 0) {
goto fail;
}
rsi_dbg(INFO_ZONE, "Card Reset Done\n");
ven_rsi_dbg(INFO_ZONE, "Card Reset Done\n");
return 0;
fail:
rsi_dbg(ERR_ZONE, "Reset card Failed\n");
ven_rsi_dbg(ERR_ZONE, "Reset card Failed\n");
return -1;
}
......@@ -774,11 +774,11 @@ static int rsi_probe(struct usb_interface *pfunction,
u32 fw_status = 0;
int status = 0;
rsi_dbg(INIT_ZONE, "%s: Init function called\n", __func__);
ven_rsi_dbg(INIT_ZONE, "%s: Init function called\n", __func__);
adapter = rsi_91x_init();
adapter = ven_rsi_91x_init();
if (!adapter) {
rsi_dbg(ERR_ZONE, "%s: Failed to init os intf ops\n",
ven_rsi_dbg(ERR_ZONE, "%s: Failed to init os intf ops\n",
__func__);
return -ENOMEM;
}
......@@ -786,12 +786,12 @@ static int rsi_probe(struct usb_interface *pfunction,
status = rsi_init_usb_interface(adapter, pfunction);
if (status) {
rsi_dbg(ERR_ZONE, "%s: Failed to init usb interface\n",
ven_rsi_dbg(ERR_ZONE, "%s: Failed to init usb interface\n",
__func__);
goto err;
}
rsi_dbg(ERR_ZONE, "%s: Initialized os intf ops\n", __func__);
ven_rsi_dbg(ERR_ZONE, "%s: Initialized os intf ops\n", __func__);
dev = (struct rsi_91x_usbdev *)adapter->rsi_dev;
......@@ -802,21 +802,21 @@ static int rsi_probe(struct usb_interface *pfunction,
fw_status &= 1;
if (!fw_status) {
rsi_dbg(INIT_ZONE, "Loading firmware...\n");
ven_rsi_dbg(INIT_ZONE, "Loading firmware...\n");
status = rsi_hal_device_init(adapter);
if (status) {
rsi_dbg(ERR_ZONE, "%s: Failed in device init\n",
ven_rsi_dbg(ERR_ZONE, "%s: Failed in device init\n",
__func__);
goto err1;
}
rsi_dbg(INIT_ZONE, "%s: Device Init Done\n", __func__);
ven_rsi_dbg(INIT_ZONE, "%s: Device Init Done\n", __func__);
}
status = rsi_rx_urb_submit(adapter, 1 /* RX_WLAN_EP */);
if (status)
goto err1;
#ifdef CONFIG_VEN_RSI_HCI
#if defined(CONFIG_VEN_RSI_HCI) || defined(CONFIG_VEN_RSI_COEX)
status = rsi_rx_urb_submit(adapter, 2 /* RX_BT_EP */);
if (status)
goto err1;
......@@ -826,8 +826,8 @@ static int rsi_probe(struct usb_interface *pfunction,
err1:
rsi_deinit_usb_interface(adapter);
err:
rsi_91x_deinit(adapter);
rsi_dbg(ERR_ZONE, "%s: Failed in probe...Exiting\n", __func__);
ven_rsi_91x_deinit(adapter);
ven_rsi_dbg(ERR_ZONE, "%s: Failed in probe...Exiting\n", __func__);
return status;
}
......@@ -844,22 +844,22 @@ static void rsi_disconnect(struct usb_interface *pfunction)
if (!adapter)
return;
rsi_mac80211_detach(adapter);
rsi_dbg(INFO_ZONE, "mac80211 detach done\n");
ven_rsi_mac80211_detach(adapter);
ven_rsi_dbg(INFO_ZONE, "mac80211 detach done\n");
rsi_reset_card(adapter);
#ifdef CONFIG_VEN_RSI_HCI
#if defined(CONFIG_VEN_RSI_HCI) || defined(CONFIG_VEN_RSI_COEX)
rsi_hci_detach(adapter->priv);
rsi_dbg(INFO_ZONE, "HCI Detach Done\n");
ven_rsi_dbg(INFO_ZONE, "HCI Detach Done\n");
#endif
rsi_reset_card(adapter);
rsi_deinit_usb_interface(adapter);
rsi_dbg(INFO_ZONE, "USB interface down\n");
ven_rsi_dbg(INFO_ZONE, "USB interface down\n");
rsi_91x_deinit(adapter);
ven_rsi_91x_deinit(adapter);
rsi_dbg(INFO_ZONE, "%s: Deinitialization completed\n", __func__);
ven_rsi_dbg(INFO_ZONE, "%s: Deinitialization completed\n", __func__);
}
#ifdef CONFIG_PM
......@@ -898,7 +898,7 @@ static struct usb_driver rsi_driver = {
static int __init rsi_usb_module_init(void)
{
rsi_dbg(INIT_ZONE,
ven_rsi_dbg(INIT_ZONE,
"=====> RSI USB Module Initialize <=====\n");
return usb_register(&rsi_driver);
}
......
......@@ -44,9 +44,9 @@ void rsi_usb_rx_thread(struct rsi_common *common)
continue;
mutex_lock(&common->rx_lock);
status = rsi_read_pkt(common, rx_cb->rx_buffer, 0);
status = ven_rsi_read_pkt(common, rx_cb->rx_buffer, 0);
if (status) {
rsi_dbg(ERR_ZONE, "%s: Failed To read data",
ven_rsi_dbg(ERR_ZONE, "%s: Failed To read data",
__func__);
mutex_unlock(&common->rx_lock);
break;
......@@ -55,7 +55,7 @@ void rsi_usb_rx_thread(struct rsi_common *common)
mutex_unlock(&common->rx_lock);
if (adapter->rx_urb_submit(adapter, rx_cb->ep_num)) {
rsi_dbg(ERR_ZONE,
ven_rsi_dbg(ERR_ZONE,
"%s: Failed in urb submission", __func__);
break;
}
......@@ -64,7 +64,7 @@ void rsi_usb_rx_thread(struct rsi_common *common)
} while (1);
rsi_dbg(INFO_ZONE, "%s: Terminated USB RX thread\n", __func__);
ven_rsi_dbg(INFO_ZONE, "%s: Terminated USB RX thread\n", __func__);
atomic_inc(&dev->rx_thread.thread_done);
complete_and_exit(&dev->rx_thread.completion, 0);
}
......
......@@ -21,6 +21,7 @@
#define RSI_COEX_TXQ_MAX_PKTS 64
#define RSI_COEX_TXQ_WATER_MARK 50
#define COMMON_CARD_READY_IND 0
#define COEX_Q 0
#define BT_Q 1
......@@ -39,14 +40,14 @@ enum rsi_proto {
struct rsi_coex_ctrl_block {
struct rsi_common *priv;
struct sk_buff_head coex_tx_qs[NUM_COEX_TX_QUEUES];
struct semaphore tx_bus_lock;
struct rsi_thread coex_tx_thread;
struct mutex coex_tx_lock;
};
int rsi_coex_init(struct rsi_common *common);
int rsi_coex_send_pkt(struct rsi_common *common,
struct sk_buff *skb,
u8 proto_type);
int rsi_coex_recv_pkt(struct rsi_common *common, u8 *msg);
void rsi_coex_deinit(struct rsi_common *common);
#endif
......@@ -80,12 +80,14 @@ static inline int rsi_kill_thread(struct rsi_thread *handle)
return kthread_stop(handle->task);
}
void rsi_mac80211_detach(struct rsi_hw *hw);
void ven_rsi_mac80211_detach(struct rsi_hw *hw);
u16 rsi_get_connected_channel(struct rsi_hw *adapter);
struct rsi_hw *rsi_91x_init(void);
void rsi_91x_deinit(struct rsi_hw *adapter);
int rsi_read_pkt(struct rsi_common *common, u8 *rx_pkt, s32 rcv_pkt_len);
struct rsi_hw *ven_rsi_91x_init(void);
void ven_rsi_91x_deinit(struct rsi_hw *adapter);
int ven_rsi_read_pkt(struct rsi_common *common, u8 *rx_pkt, s32 rcv_pkt_len);
void rsi_indicate_bcnmiss(struct rsi_common *common);
void rsi_resume_conn_channel(struct rsi_hw *adapter);
void rsi_hci_detach(struct rsi_common *common);
inline char *dot11_pkt_type(__le16 frame_control);
struct rsi_sta *rsi_find_sta(struct rsi_common *common, u8 *mac_addr);
#endif
......@@ -14,8 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef __RSI_DEBUGFS_H__
#define __RSI_DEBUGFS_H__
#ifndef __VEN_RSI_DEBUGFS_H__
#define __VEN_RSI_DEBUGFS_H__
#include "rsi_main.h"
#include <linux/debugfs.h>
......
......@@ -145,8 +145,11 @@ struct ta_metadata {
unsigned int address;
};
int rsi_prepare_mgmt_desc(struct rsi_common *common, struct sk_buff *skb);
int rsi_prepare_data_desc(struct rsi_common *common, struct sk_buff *skb);
int rsi_hal_device_init(struct rsi_hw *adapter);
int rsi_send_data_pkt(struct rsi_common *common, struct sk_buff *skb);
int rsi_send_bt_pkt(struct rsi_common *common, struct sk_buff *skb);
int rsi_send_beacon(struct rsi_common *common);
#endif
......@@ -93,13 +93,11 @@ struct rsi_hci_adapter {
struct hci_dev *hdev;
struct genl_cb *gcb;
struct sk_buff_head hci_tx_queue;
int fsm_state;
};
int rsi_genl_recv (struct sk_buff *skb, struct genl_info *info);
int rsi_hci_attach (struct rsi_common *common);
void rsi_hci_detach(struct rsi_common *common);
//int rsi_hci_recv_pkt(struct rsi_hci_adapter *h_adapter, u8 *pkt);
int rsi_hci_recv_pkt(struct rsi_common *common, u8 *pkt);
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -29,7 +29,7 @@
#define RSI_USB_TX_HEAD_ROOM 128
#define MAX_TX_URBS 1
#ifdef CONFIG_VEN_RSI_HCI
#if defined (CONFIG_VEN_RSI_HCI) || defined(CONFIG_VEN_RSI_COEX)
#define MAX_RX_URBS 2
#else
#define MAX_RX_URBS 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment