*/
#define R4_PANIC_RECORD_VERSION_2 2
#define R4_PANIC_RECORD_LENGTH_INDEX_V2 1
+#define R4_PANIC_STACK_RECORD_OFFSET_INDEX_V2 52
#define R4_PANIC_RECORD_MAX_LENGTH_V2 256
+/* Panic stack record (optional) - linked to from panic record */
+#define R4_PANIC_STACK_RECORD_VERSION_1 1
+#define R4_PANIC_STACK_RECORD_VERSION_INDEX 0
+#define R4_PANIC_STACK_RECORD_LENGTH_INDEX 1
+#define R4_PANIC_STACK_RECORD_MAX_LENGTH 256
+
/*
* version 1 mr4 panic record defs
*/
static void panic_record_dump(u32 *panic_record, u32 panic_record_length, bool r4)
{
- int i;
+ u32 i;
SCSC_TAG_INFO(FW_PANIC, "%s panic record dump(length=%d):\n",
r4 ? "R4" : "M4", panic_record_length);
r4 ? "r4" : "m4", i, panic_record[i]);
}
-static bool fw_parse_r4_panic_record_v2(u32 *r4_panic_record, u32 *r4_panic_record_length)
+static void panic_stack_record_dump(u32 *panic_stack_record, u32 panic_stack_record_length, bool r4)
+{
+ u32 i;
+
+ SCSC_TAG_INFO(FW_PANIC, "%s panic stack_record dump(length=%d):\n",
+ r4 ? "R4" : "M4", panic_stack_record_length);
+ for (i = 0; i < panic_stack_record_length; i++)
+ SCSC_TAG_INFO(FW_PANIC, "%s_panic_stack_record[%d] = %08x\n",
+ r4 ? "r4" : "m4", i, panic_stack_record[i]);
+}
+
+static bool fw_parse_r4_panic_record_v2(u32 *r4_panic_record, u32 *r4_panic_record_length, u32 *r4_panic_stack_record_offset)
{
u32 panic_record_cksum;
u32 calculated_cksum;
calculated_cksum);
panic_record_dump(r4_panic_record, panic_record_length, true);
*r4_panic_record_length = panic_record_length;
+ /* Optionally extract the offset of the panic stack record */
+ if (r4_panic_stack_record_offset) {
+ *r4_panic_stack_record_offset = *(r4_panic_record + R4_PANIC_STACK_RECORD_OFFSET_INDEX_V2);
+ }
return true;
} else {
SCSC_TAG_ERR(FW_PANIC, "BAD panic_record_cksum: 0x%x calculated_cksum: 0x%x\n",
return false;
}
+static bool fw_parse_r4_panic_stack_record_v1(u32 *r4_panic_stack_record, u32 *r4_panic_stack_record_length)
+{
+ u32 panic_stack_record_length = *(r4_panic_stack_record + R4_PANIC_STACK_RECORD_LENGTH_INDEX) / 4;
+
+ if (panic_stack_record_length < R4_PANIC_STACK_RECORD_MAX_LENGTH) {
+ panic_stack_record_dump(r4_panic_stack_record, panic_stack_record_length, true);
+ *r4_panic_stack_record_length = panic_stack_record_length;
+ return true;
+ } else {
+ SCSC_TAG_ERR(FW_PANIC, "BAD panic_stack_record_length: %d\n",
+ panic_stack_record_length);
+ }
+ return false;
+}
+
static bool fw_parse_m4_panic_record_v1(u32 *m4_panic_record, u32 *m4_panic_record_length)
{
u32 panic_record_cksum;
return false;
}
-bool fw_parse_r4_panic_record(u32 *r4_panic_record, u32 *r4_panic_record_length)
+bool fw_parse_r4_panic_record(u32 *r4_panic_record, u32 *r4_panic_record_length, u32 *r4_panic_stack_record_offset)
{
u32 panic_record_version = *(r4_panic_record + PANIC_RECORD_R4_VERSION_INDEX);
panic_record_version);
break;
case R4_PANIC_RECORD_VERSION_2:
- return fw_parse_r4_panic_record_v2(r4_panic_record, r4_panic_record_length);
+ return fw_parse_r4_panic_record_v2(r4_panic_record, r4_panic_record_length, r4_panic_stack_record_offset);
+ }
+ return false;
+}
+
+bool fw_parse_r4_panic_stack_record(u32 *r4_panic_stack_record, u32 *r4_panic_stack_record_length)
+{
+ u32 panic_stack_record_version = *(r4_panic_stack_record + R4_PANIC_STACK_RECORD_VERSION_INDEX);
+
+ SCSC_TAG_INFO(FW_PANIC, "panic_stack_record_version: %d\n", panic_stack_record_version);
+
+ switch (panic_stack_record_version) {
+ default:
+ SCSC_TAG_ERR(FW_PANIC, "BAD panic_stack_record_version: %d\n",
+ panic_stack_record_version);
+ break;
+ case R4_PANIC_STACK_RECORD_VERSION_1:
+ return fw_parse_r4_panic_stack_record_v1(r4_panic_stack_record, r4_panic_stack_record_length);
}
return false;
}
#ifndef FW_PANIC_RECORD_H__
#define FW_PANIC_RECORD_H__
-bool fw_parse_r4_panic_record(u32 *r4_panic_record, u32 *r4_panic_record_length);
+bool fw_parse_r4_panic_record(u32 *r4_panic_record, u32 *r4_panic_record_length,
+ u32 *r4_panic_stack_record_offset);
+bool fw_parse_r4_panic_stack_record(u32 *r4_panic_stack_record, u32 *r4_panic_stack_record_length);
bool fw_parse_m4_panic_record(u32 *m4_panic_record, u32 *m4_panic_record_length);
bool fw_parse_get_r4_sympathetic_panic_flag(u32 *r4_panic_record);
unsigned int available;
unsigned int i;
unsigned int min_available_blocks = MIFRAMMAN_NUM_BLOCKS;
- size_t num_blocks;
+ size_t num_blocks = 0;
void *free_mem = NULL;
bool has_available_blocks = false;
#define SCSC_R4_V2_MINOR_52 52
#define SCSC_R4_V2_MINOR_53 53
+#define SCSC_R4_V2_MINOR_54 54
#define MM_HALT_RSP_TIMEOUT_MS 100
void mxman_show_last_panic(struct mxman *mxman)
{
u32 r4_panic_record_length = 0; /* in u32s */
+ u32 r4_panic_stack_record_length = 0; /* in u32s */
/* Any valid panic? */
if (mxman->scsc_panic_code == 0)
case SCSC_PANIC_ORIGIN_FW:
SCSC_TAG_INFO(MXMAN, "Last panic was FW:\n");
- fw_parse_r4_panic_record(mxman->last_panic_rec_r, &r4_panic_record_length);
+ fw_parse_r4_panic_record(mxman->last_panic_rec_r, &r4_panic_record_length, NULL);
+ fw_parse_r4_panic_stack_record(mxman->last_panic_stack_rec_r, &r4_panic_stack_record_length);
break;
default:
static void process_panic_record(struct mxman *mxman)
{
u32 *r4_panic_record = NULL;
+ u32 *r4_panic_stack_record = NULL;
u32 *m4_panic_record = NULL;
#ifdef CONFIG_SCSC_MX450_GDB_SUPPORT
u32 *m4_1_panic_record = NULL;
#endif
u32 r4_panic_record_length = 0; /* in u32s */
+ u32 r4_panic_stack_record_offset = 0; /* in bytes */
+ u32 r4_panic_stack_record_length = 0; /* in u32s */
u32 m4_panic_record_length = 0; /* in u32s */
#ifdef CONFIG_SCSC_MX450_GDB_SUPPORT
u32 m4_1_panic_record_length = 0; /* in u32s */
#endif
u32 full_panic_code = 0;
bool r4_panic_record_ok = false;
+ bool r4_panic_stack_record_ok = false;
bool m4_panic_record_ok = false;
#ifdef CONFIG_SCSC_MX450_GDB_SUPPORT
bool m4_1_panic_record_ok = false;
if ((mxman->scsc_panic_code & SCSC_PANIC_ORIGIN_MASK) == SCSC_PANIC_ORIGIN_FW) {
if (mxman->fwhdr.r4_panic_record_offset) {
r4_panic_record = (u32 *)(mxman->fw + mxman->fwhdr.r4_panic_record_offset);
- r4_panic_record_ok = fw_parse_r4_panic_record(r4_panic_record, &r4_panic_record_length);
+ r4_panic_record_ok = fw_parse_r4_panic_record(r4_panic_record, &r4_panic_record_length,
+ &r4_panic_stack_record_offset);
} else {
SCSC_TAG_INFO(MXMAN, "R4 panic record doesn't exist in the firmware header\n");
}
mxman->scsc_panic_code |= SCSC_PANIC_TECH_UNSP;
print_panic_code_legacy(mxman->scsc_panic_code);
break;
+ case SCSC_R4_V2_MINOR_54:
case SCSC_R4_V2_MINOR_53:
if (r4_panic_record_ok) {
/* Save the last R4 panic record for future display */
- BUG_ON(sizeof(mxman->last_panic_rec_r) < SCSC_R4_V2_MINOR_53 * sizeof(u32));
- memcpy((u8 *)mxman->last_panic_rec_r, (u8 *)r4_panic_record, SCSC_R4_V2_MINOR_53 * sizeof(u32));
+ BUG_ON(sizeof(mxman->last_panic_rec_r) < r4_panic_record_length * sizeof(u32));
+ memcpy((u8 *)mxman->last_panic_rec_r, (u8 *)r4_panic_record, r4_panic_record_length * sizeof(u32));
mxman->last_panic_rec_sz = r4_panic_record_length;
r4_sympathetic_panic_flag = fw_parse_get_r4_sympathetic_panic_flag(r4_panic_record);
r4_panic_record_ok,
r4_sympathetic_panic_flag
);
+ /* Check panic stack if present */
+ if (r4_panic_record_length >= SCSC_R4_V2_MINOR_54) {
+ r4_panic_stack_record = (u32 *)(mxman->fw + r4_panic_stack_record_offset);
+ r4_panic_stack_record_ok = fw_parse_r4_panic_stack_record(r4_panic_stack_record, &r4_panic_stack_record_length);
+ } else {
+ r4_panic_stack_record_ok = false;
+ r4_panic_stack_record_length = 0;
+ }
if (r4_sympathetic_panic_flag == false) {
/* process R4 record */
SCSC_TAG_INFO(MXMAN, "process R4 record\n");
u32 rf_hw_ver;
u16 scsc_panic_code;
u64 last_panic_time;
- u32 last_panic_rec_r[PANIC_RECORD_SIZE]; /* Must be at least SCSC_R4_V2_MINOR_53 */
+ u32 last_panic_rec_r[PANIC_RECORD_SIZE]; /* Must be at least SCSC_R4_V2_MINOR_54 */
u16 last_panic_rec_sz;
+ u32 last_panic_stack_rec_r[PANIC_STACK_RECORD_SIZE]; /* Must be at least SCSC_R4_V2_MINOR_54 */
+ u16 last_panic_stack_rec_sz;
struct mx_syserr_decode last_syserr;
unsigned long last_syserr_recovery_time; /* In jiffies */
bool notify;
platform_int_debug(platform);
if (platform->reset_request_handler != platform_mif_irq_reset_request_default_handler) {
- disable_irq_nosync(platform->wlbt_irq[PLATFORM_MIF_WDOG].irq_num);
- platform->reset_request_handler(irq, platform->irq_reset_request_dev);
if (platform->boot_state == WLBT_BOOT_WAIT_CFG_REQ) {
/* Spurious interrupt from the SOC during CFG_REQ phase, just consume it */
SCSC_TAG_INFO_DEV(PLAT_MIF, platform->dev, "Spurious wdog irq during cfg_req phase\n");
u8 *rsn_ie;
u8 rsn_ie_len;
#endif
+
+ /* Storing channel bitmap to use it for setting cached channels */
+ u16 channels_24_ghz;
+ u32 channels_5_ghz;
};
struct slsi_vif_unsync {
*
****************************************************************************/
+#ifndef __HIP4_SAMPLER_H__
+#define __HIP4_SAMPLER_H__
+
#include <linux/proc_fs.h>
#include <linux/version.h>
#include <linux/seq_file.h>
#include "dev.h"
-/* TCP send buffer sizes */
-extern int sysctl_tcp_wmem[3];
-
-#ifndef __HIP4_SAMPLER_H__
-#define __HIP4_SAMPLER_H__
-
#define HIP4_SAMPLER_SIGNAL_CTRLTX 0x20
#define HIP4_SAMPLER_SIGNAL_CTRLRX 0x21
#define HIP4_SAMPLER_THROUG 0x22
group_dev = slsi_get_netdev(sdev, SLSI_NET_INDEX_P2PX_SWLAN);
if (!group_dev) {
SLSI_INFO(sdev, "No Group net_dev found\n");
- return -EINVAL;
+ result = -EINVAL;
+ goto exit;
}
readbyte = slsi_str_to_int(&ecsa_params[offset], &channel);
if (!readbyte) {
return -EINVAL;
}
- if (band < 0 || band > 2) {
+ if (band > 2) {
SLSI_ERR(sdev, "Invalid Band: Must be 0/1/2 Not '%c'\n", band);
SLSI_MUTEX_UNLOCK(sdev->device_config_mutex);
return -EINVAL;
SLSI_DBG1_NODEV(SLSI_MLME, "mlme_set_band_req(vif:%u band:%u)\n", ndev_vif->ifnum, band);
req = fapi_alloc(mlme_set_band_req, MLME_SET_BAND_REQ, ndev_vif->ifnum, 0);
+ if (!req) {
+ SLSI_MUTEX_UNLOCK(ndev_vif->vif_mutex);
+ return -EIO;
+ }
fapi_set_u16(req, u.mlme_set_band_req.vif, ndev_vif->ifnum);
fapi_set_u16(req, u.mlme_set_band_req.band, band);
cfm = slsi_mlme_req_cfm(sdev, dev, req, MLME_SET_BAND_CFM);
SLSI_DBG1_NODEV(SLSI_MLME, "mlme_set_roaming_type_req(vif:%u mode:%u)\n", ndev_vif->ifnum, mode);
req = fapi_alloc(mlme_set_roaming_type_req, MLME_SET_ROAMING_TYPE_REQ, ndev_vif->ifnum, 0);
+ if (!req) {
+ SLSI_MUTEX_UNLOCK(ndev_vif->vif_mutex);
+ return -EIO;
+ }
fapi_set_u16(req, u.mlme_set_roaming_type_req.vif, ndev_vif->ifnum);
fapi_set_u16(req, u.mlme_set_roaming_type_req.roaming_type, mode);
cfm = slsi_mlme_req_cfm(sdev, dev, req, MLME_SET_ROAMING_TYPE_CFM);
#ifdef CONFIG_SCSC_LOG_COLLECTION
scsc_log_collector_schedule_collection(SCSC_LOG_DUMPSTATE, SCSC_LOG_DUMPSTATE_REASON_DRIVERDEBUGDUMP);
#else
+#ifndef SLSI_TEST_DEV
ret = mx140_log_dump();
#endif
#endif
+#endif
#ifdef CONFIG_SCSC_WLAN_ENHANCED_PKT_FILTER
} else if ((strncasecmp(command, CMD_ENHANCED_PKT_FILTER, strlen(CMD_ENHANCED_PKT_FILTER)) == 0)) {
const u8 enable = *(command + strlen(CMD_ENHANCED_PKT_FILTER) + 1) - '0';
/* Register sysfs mac address override */
void slsi_create_sysfs_macaddr(void)
{
+#ifndef SLSI_TEST_DEV
int r;
wifi_kobj_ref = mxman_wifi_kobject_ref_get();
} else {
pr_err("failed to create /sys/wifi/mac_addr\n");
}
+#endif
}
/* Unregister sysfs mac address override */
return;
}
#endif
+#ifndef SLSI_TEST_DEV
mxman_get_fw_version(build_id_fw, 128);
mxman_get_driver_version(build_id_drv, 64);
+#endif
/* WARNING:
* Please do not change the format of the following string
goto err_hip_started;
}
}
-
if (sdev->regdb.regdb_state == SLSI_REG_DB_SET) {
sdev->reg_dom_version = ((sdev->regdb.db_major_version & 0xFF) << 8) |
(sdev->regdb.db_minor_version & 0xFF);
}
memcpy(alpha2, sdev->device_config.domain_info.regdomain->alpha2, 2);
+
/* unifiDefaultCountry != world_domain */
if (!(alpha2[0] == '0' && alpha2[1] == '0'))
/* Read the regulatory params for the country*/
if (!mib_file_name || !fw)
return -EINVAL;
+#ifdef CONFIG_SCSC_LOG_COLLECTION
if (index > SLSI_WLAN_MAX_MIB_FILE + 1) {
SLSI_ERR(sdev, "collect mib index is invalid:%d\n", index);
return -EINVAL;
}
+#endif
mib_info->mib_data = NULL;
mib_info->mib_len = 0;
mib_info->mib_hash = 0; /* Reset mib hash value */
}
SLSI_DBG1(sdev, SLSI_CFG80211, "Value for NAN enabled mib : %d\n", sdev->nan_enabled);
- if (values[++mib_index].type != SLSI_MIB_TYPE_NONE) { /* UnifiForcedScheduleDuration */
+ if (values[++mib_index].type != SLSI_MIB_TYPE_NONE) { /* UnifiDefaultDwellTime */
SLSI_CHECK_TYPE(sdev, values[mib_index].type, SLSI_MIB_TYPE_UINT);
- sdev->fw_dwell_time = values[mib_index].u.uintValue;
+ sdev->fw_dwell_time = (values[mib_index].u.uintValue) * 1024; /* Conveting TU to Microseconds */
} else {
SLSI_WARN(sdev, "Error reading UnifiForcedScheduleDuration\n");
}
void slsi_wlan_dump_public_action_subtype(struct slsi_dev *sdev, struct ieee80211_mgmt *mgmt, bool tx)
{
- u8 action_code = ((u8 *)&mgmt->u.action.u)[0];
+ int action_code = ((int *)&mgmt->u.action.u)[0];
u8 action_category = mgmt->u.action.category;
char *tx_rx_string = "Received";
char wnm_action_fields[28][35] = { "Event Request", "Event Report", "Diagnostic Request",
return index;
}
-static struct slsi_roaming_network_map_entry *slsi_roam_channel_cache_get(struct net_device *dev, const u8 *ssid)
+struct slsi_roaming_network_map_entry *slsi_roam_channel_cache_get(struct net_device *dev, const u8 *ssid)
{
struct slsi_roaming_network_map_entry *network_map = NULL;
struct netdev_vif *ndev_vif = netdev_priv(dev);
return channels_count;
}
-static bool slsi_roam_channel_cache_single_ap(struct net_device *dev, const u8 *ssid)
-{
- bool only_one_ap_seen = true;
- struct slsi_roaming_network_map_entry *network_map;
-
- network_map = slsi_roam_channel_cache_get(dev, ssid);
- if (network_map)
- only_one_ap_seen = network_map->only_one_ap_seen;
-
- return only_one_ap_seen;
-}
-
int slsi_roaming_scan_configure_channels(struct slsi_dev *sdev, struct net_device *dev, const u8 *ssid, u8 *channels)
{
struct netdev_vif *ndev_vif = netdev_priv(dev);
WARN_ON(ndev_vif->vif_type != FAPI_VIFTYPE_STATION);
cached_channels_count = slsi_roam_channel_cache_get_channels(dev, ssid, channels);
- if (slsi_roam_channel_cache_single_ap(dev, ssid)) {
- SLSI_NET_DBG3(dev, SLSI_MLME, "Skip Roaming Scan for Single AP %.*s\n", ssid[1], &ssid[2]);
- return 0;
- }
-
SLSI_NET_DBG3(dev, SLSI_MLME, "Roaming Scan Channels. %d cached\n", cached_channels_count);
return cached_channels_count;
int slsi_read_regulatory_rules(struct slsi_dev *sdev, struct slsi_802_11d_reg_domain *domain_info, const char *alpha2);
int slsi_read_regulatory_rules_fw(struct slsi_dev *sdev, struct slsi_802_11d_reg_domain *domain_info, const char *alpha2);
int slsi_send_acs_event(struct slsi_dev *sdev, struct slsi_acs_selected_channels acs_selected_channels);
+struct slsi_roaming_network_map_entry *slsi_roam_channel_cache_get(struct net_device *dev, const u8 *ssid);
+int slsi_roam_channel_cache_get_channels_int(struct net_device *dev, struct slsi_roaming_network_map_entry *network_map, u8 *channels);
#ifdef CONFIG_SCSC_WLAN_ENABLE_MAC_RANDOMISATION
int slsi_set_mac_randomisation_mask(struct slsi_dev *sdev, u8 *mac_address_mask);
#endif
strSize++;
if (strSize > 2) {
char *line = kmalloc(strSize + 1, GFP_KERNEL);
+ if (!line) {
+ SLSI_ERR_NODEV("Memory allocation failed!\n", line);
+ return false;
+ }
(void)strncpy(line, lineStart, strSize);
line[strSize] = '\0';
if (!CsrWifiMibConvertTextParseLine(line, mibDataSet, mibDataGet)) {
struct sk_buff *cfm;
int r = 0;
- WARN_ON(!SLSI_MUTEX_IS_LOCKED(ndev_vif->vif_mutex));
+ SLSI_MUTEX_LOCK(ndev_vif->vif_mutex);
req = fapi_alloc(mlme_wifisharing_permitted_channels_req, MLME_WIFISHARING_PERMITTED_CHANNELS_REQ,
ndev_vif->ifnum, 8);
}
int slsi_mlme_add_range_req(struct slsi_dev *sdev, u8 count,
- struct slsi_rtt_config *nl_rtt_params, u16 rtt_id, u16 vif_idx, u8 *source_addr)
+ struct slsi_rtt_config *nl_rtt_params, u16 rtt_id, u8 *source_addr)
{
struct sk_buff *req;
struct sk_buff *rx;
SLSI_DBG2(sdev, SLSI_MLME, "count:%d allocated data size: %d, source_addr:%pM\n",
count, alloc_data_size, source_addr);
/*fill the data */
- fapi_set_u16(req, u.mlme_add_range_req.vif, vif_idx);
+ fapi_set_u16(req, u.mlme_add_range_req.vif, 0);
fapi_set_u16(req, u.mlme_add_range_req.rtt_id, rtt_id);
fapi_set_memcpy(req, u.mlme_add_range_req.device_address, source_addr);
for (i = 0; i < count; i++) {
fapi_append_data(req, fapi_ie_generic, sizeof(fapi_ie_generic));
fapi_append_data(req, nl_rtt_params[i].peer_addr, ETH_ALEN);
- fapi_append_data(req, (u8 *)&nl_rtt_params[i].type, 2);
+ fapi_append_data(req, (u8 *)&nl_rtt_params[i].rtt_peer, 1);
+ fapi_append_data(req, (u8 *)&nl_rtt_params[i].rtt_type, 1);
fapi_append_data(req, (u8 *)&nl_rtt_params[i].channel_freq, 2);
fapi_append_data(req, (u8 *)&nl_rtt_params[i].burst_period, 1);
fapi_append_data(req, (u8 *)&nl_rtt_params[i].num_burst, 1);
if (be16_to_cpu(ip_hdr(skb)->tot_len) > ((ip_hdr(skb)->ihl * 4) + (tcp_hdr(skb)->doff * 4))) {
SCSC_HIP4_SAMPLER_TCP_DATA(ndev_vif->sdev->minor_prof, tcp_ack->stream_id, be32_to_cpu(tcp_hdr(skb)->seq));
SCSC_HIP4_SAMPLER_TCP_CWND(ndev_vif->sdev->minor_prof, tcp_ack->stream_id, (skb->sk) ? tcp_sk(skb->sk)->snd_cwnd : 0);
- #if KERNEL_VERSION(4, 14, 0) >= LINUX_VERSION_CODE
- SCSC_HIP4_SAMPLER_TCP_SEND_BUG(ndev_vif->sdev->minor_prof, tcp_ack->stream_id, sysctl_tcp_wmem[2]);
- #else
- SCSC_HIP4_SAMPLER_TCP_SEND_BUF(ndev_vif->sdev->minor_prof, tcp_ack->stream_id, sysctl_tcp_mem[2]);
- #endif
+ SCSC_HIP4_SAMPLER_TCP_SEND_BUF(ndev_vif->sdev->minor_prof, tcp_ack->stream_id, (skb->sk) ? (skb->sk)->sk_sndbuf : 0);
ndev_vif->tcp_ack_stats.tack_hasdata++;
forward_now = 1;
goto _forward_now;
type = nla_type(iter);
switch (type) {
case SLSI_ATTRIBUTE_EPNO_MINIMUM_5G_RSSI:
- slsi_util_nla_get_u16(iter, &epno_params->min_5g_rssi);
+ if (slsi_util_nla_get_u16(iter, &epno_params->min_5g_rssi)) {
+ r = -EINVAL;
+ goto exit;
+ }
break;
case SLSI_ATTRIBUTE_EPNO_MINIMUM_2G_RSSI:
- slsi_util_nla_get_u16(iter, &epno_params->min_2g_rssi);
+ if (slsi_util_nla_get_u16(iter, &epno_params->min_2g_rssi)) {
+ r = -EINVAL;
+ goto exit;
+ }
break;
case SLSI_ATTRIBUTE_EPNO_INITIAL_SCORE_MAX:
- slsi_util_nla_get_u16(iter, &epno_params->initial_score_max);
+ if (slsi_util_nla_get_u16(iter, &epno_params->initial_score_max)) {
+ r = -EINVAL;
+ goto exit;
+ }
break;
case SLSI_ATTRIBUTE_EPNO_CUR_CONN_BONUS:
- slsi_util_nla_get_u8(iter, &epno_params->current_connection_bonus);
+ if (slsi_util_nla_get_u8(iter, &epno_params->current_connection_bonus)) {
+ r = -EINVAL;
+ goto exit;
+ }
break;
case SLSI_ATTRIBUTE_EPNO_SAME_NETWORK_BONUS:
- slsi_util_nla_get_u8(iter, &epno_params->same_network_bonus);
+ if (slsi_util_nla_get_u8(iter, &epno_params->same_network_bonus)) {
+ r = -EINVAL;
+ goto exit;
+ }
break;
case SLSI_ATTRIBUTE_EPNO_SECURE_BONUS:
- slsi_util_nla_get_u8(iter, &epno_params->secure_bonus);
+ if (slsi_util_nla_get_u8(iter, &epno_params->secure_bonus)) {
+ r = -EINVAL;
+ goto exit;
+ }
break;
case SLSI_ATTRIBUTE_EPNO_5G_BONUS:
- slsi_util_nla_get_u8(iter, &epno_params->band_5g_bonus);
+ if (slsi_util_nla_get_u8(iter, &epno_params->band_5g_bonus)) {
+ r = -EINVAL;
+ goto exit;
+ }
break;
case SLSI_ATTRIBUTE_EPNO_SSID_LIST:
nla_for_each_nested(outer, iter, tmp) {
}
break;
case SLSI_ATTRIBUTE_EPNO_SSID_NUM:
- slsi_util_nla_get_u8(iter, &val);
+ if (slsi_util_nla_get_u8(iter, &val)) {
+ r = -EINVAL;
+ goto exit;
+ }
num = (int)val;
if (num > SLSI_GSCAN_MAX_EPNO_SSIDS) {
SLSI_ERR(sdev, "Cannot support %d SSIDs. max %d\n", num, SLSI_GSCAN_MAX_EPNO_SSIDS);
int tmp, tmp1, tmp2;
u16 rtt_id = 0;
u8 num_devices = 0;
- u16 rtt_peer = SLSI_RTT_PEER_AP;
- u16 vif_idx = 0;
+ u8 rtt_peer = SLSI_RTT_PEER_AP;
u16 channel_freq = 0;
SLSI_DBG1_NODEV(SLSI_GSCAN, "SUBCMD_RTT_RANGE_START\n");
return -EINVAL;
break;
case SLSI_RTT_ATTRIBUTE_TARGET_TYPE:
- if (slsi_util_nla_get_u16(inner, &(nl_rtt_params[j].type)))
+ if (slsi_util_nla_get_u8(inner, &(nl_rtt_params[j].rtt_type)))
return -EINVAL;
break;
case SLSI_RTT_ATTRIBUTE_TARGET_PEER:
- if (slsi_util_nla_get_u16(inner, &rtt_peer))
+ if (slsi_util_nla_get_u8(inner, &rtt_peer))
return -EINVAL;
+ nl_rtt_params[j].rtt_peer = rtt_peer;
break;
case SLSI_RTT_ATTRIBUTE_TARGET_CHAN_FREQ:
if (slsi_util_nla_get_u16(inner, &channel_freq))
return WIFI_HAL_ERROR_NOT_SUPPORTED;
}
ndev_vif = netdev_priv(dev);
- if (ndev_vif->activated) {
- vif_idx = ndev_vif->vif_type;
- } else {
+ if (!ndev_vif->activated) {
SLSI_ERR(sdev, "NAN vif not activated\n");
kfree(nl_rtt_params);
return -EINVAL;
return -ENOTSUPP;
#endif
}
- r = slsi_mlme_add_range_req(sdev, num_devices, nl_rtt_params, rtt_id, vif_idx, source_addr);
+ r = slsi_mlme_add_range_req(sdev, num_devices, nl_rtt_params, rtt_id, source_addr);
if (r) {
r = -EINVAL;
SLSI_ERR_NODEV("Failed to set rtt config\n");
} else {
- sdev->rtt_vif[rtt_id] = vif_idx;
+ sdev->rtt_vif[rtt_id] = 0;
SLSI_DBG1_NODEV(SLSI_GSCAN, "Successfully set rtt config\n");
}
kfree(nl_rtt_params);
ip_ptr += 2;
res |= nla_put_u8(nl_skb, SLSI_RTT_EVENT_ATTR_RETRY_AFTER_DURATION, *ip_ptr++);
- le16_ptr = (__le16 *)&ip_ptr[i];
- value = le16_to_cpu(*le16_ptr);
- res |= nla_put_u16(nl_skb, SLSI_RTT_EVENT_ATTR_TYPE, value);
- ip_ptr += 2;
-
+ res |= nla_put_u8(nl_skb, SLSI_RTT_EVENT_ATTR_TYPE, *ip_ptr++);
le16_ptr = (__le16 *)&ip_ptr[i];
value = le16_to_cpu(*le16_ptr);
res |= nla_put_u16(nl_skb, SLSI_RTT_EVENT_ATTR_RSSI, value);
/* RTT configuration */
struct slsi_rtt_config {
u8 peer_addr[ETH_ALEN]; /* peer device mac address */
- u16 type; /* 1-sided or 2-sided RTT */
+ u8 rtt_peer; /* optional - peer device hint (STA, P2P, AP) */
+ u8 rtt_type; /* 1-sided or 2-sided RTT */
u16 channel_freq; /* Required for STA-AP mode, optional for P2P, NBD etc. */
u16 channel_info;
u8 burst_period; /* Time interval between bursts (units: 100 ms). */
int slsi_mib_get_apf_cap(struct slsi_dev *sdev, struct net_device *dev);
int slsi_mib_get_rtt_cap(struct slsi_dev *sdev, struct net_device *dev, struct slsi_rtt_capabilities *cap);
int slsi_mlme_add_range_req(struct slsi_dev *sdev, u8 count, struct slsi_rtt_config *nl_rtt_params,
- u16 rtt_id, u16 vif_idx, u8 *source_addr);
+ u16 rtt_id, u8 *source_addr);
int slsi_mlme_del_range_req(struct slsi_dev *sdev, struct net_device *dev, u16 count, u8 *addr, u16 rtt_id);
void slsi_rx_range_ind(struct slsi_dev *sdev, struct net_device *dev, struct sk_buff *skb);
void slsi_rx_range_done_ind(struct slsi_dev *sdev, struct net_device *dev, struct sk_buff *skb);
u32 peer_ps_state_transitions = 0;
enum scsc_wifi_fcq_8021x_state cp_state;
- if (scsc_wifi_fcq_stat_queueset(&ndev_vif->ap.group_data_qs, &queue_stat, &smod, &scod, &cp_state, &peer_ps_state_transitions) != 0)
+ if (scsc_wifi_fcq_stat_queueset(&ndev_vif->ap.group_data_qs, &queue_stat, &smod, &scod, &cp_state, &peer_ps_state_transitions) != 0) {
+ SLSI_MUTEX_UNLOCK(ndev_vif->vif_mutex);
continue;
+ }
seq_printf(m, "|%-12s|%-6d|%-6s|\n%d). smod:%u, scod:%u, netq stops :%u, netq resumes :%u, PS transitions :%u Controlled port :%s\n",
netdev_name(dev),
return;
}
#endif
+ /* set_cached_channels should be called here as well , apart from connect_ind as */
+ /* we can get an AP with the same SSID in the scan results after connection. */
+ /* This should only be done if we are in connected state.*/
+ if (ndev_vif->vif_type == FAPI_VIFTYPE_STATION && ndev_vif->sta.vif_status == SLSI_VIF_STATUS_CONNECTED &&
+ ndev_vif->iftype != NL80211_IFTYPE_P2P_CLIENT) {
+ const u8 *connected_ssid = NULL;
+ struct slsi_roaming_network_map_entry *network_map;
+ u32 channels_count = 0;
+ u8 channels[SLSI_ROAMING_CHANNELS_MAX];
+ bool channel_bitmaps_matched = false;
+
+ connected_ssid = cfg80211_find_ie(WLAN_EID_SSID, ndev_vif->sta.sta_bss->ies->data,
+ ndev_vif->sta.sta_bss->ies->len);
+ network_map = slsi_roam_channel_cache_get(dev, connected_ssid);
+ if (network_map) {
+ channel_bitmaps_matched = !(network_map->channels_24_ghz & ~ndev_vif->sta.channels_24_ghz) &&
+ !(network_map->channels_5_ghz & ~ndev_vif->sta.channels_5_ghz);
+ if (!channel_bitmaps_matched)
+ channels_count = slsi_roam_channel_cache_get_channels_int(dev, network_map, channels);
+ }
+
+ if (channels_count) {
+ ndev_vif->sta.channels_24_ghz = network_map->channels_24_ghz;
+ ndev_vif->sta.channels_5_ghz = network_map->channels_5_ghz;
+ if (slsi_mlme_set_cached_channels(sdev, dev, channels_count, channels) != 0)
+ SLSI_NET_ERR(dev, "MLME-SET-CACHED-CHANNELS.req failed\n");
+ }
+ }
+
scan_id = (scan_id & 0xFF);
if (scan_id == SLSI_SCAN_HW_ID && (ndev_vif->scan[SLSI_SCAN_HW_ID].scan_req ||
if (ndev_vif->vif_type == FAPI_VIFTYPE_STATION && ndev_vif->activated && ndev_vif->iftype != NL80211_IFTYPE_P2P_CLIENT) {
#endif
const u8 *ssid = cfg80211_find_ie(WLAN_EID_SSID, assoc_ie, assoc_ie_len);
+ struct slsi_roaming_network_map_entry *network_map;
u8 channels[SLSI_ROAMING_CHANNELS_MAX];
u32 channels_count = slsi_roaming_scan_configure_channels(sdev, dev, ssid, channels);
+ network_map = slsi_roam_channel_cache_get(dev, ssid);
+ if (network_map) {
+ ndev_vif->sta.channels_24_ghz = network_map->channels_24_ghz;
+ ndev_vif->sta.channels_5_ghz = network_map->channels_5_ghz;
+ }
if (channels_count)
if (slsi_mlme_set_cached_channels(sdev, dev, channels_count, channels) != 0)
SLSI_NET_ERR(dev, "MLME-SET-CACHED-CHANNELS.req failed\n");
#ifdef CONFIG_SCSC_LOG_COLLECTION
scsc_log_collector_schedule_collection(SCSC_LOG_HOST_WLAN, SCSC_LOG_HOST_WLAN_REASON_DISCONNECT_IND);
#else
+#ifndef SLSI_TEST_DEV
mx140_log_dump();
+#endif
#endif
SLSI_INFO(sdev, "Received DEAUTH, reason = 0\n");
#ifdef CONFIG_SCSC_LOG_COLLECTION
scsc_log_collector_schedule_collection(SCSC_LOG_HOST_WLAN, SCSC_LOG_HOST_WLAN_REASON_DISCONNECTED_IND);
#else
+#ifndef SLSI_TEST_DEV
mx140_log_dump();
+#endif
#endif
if (reason <= 0xFF) {
SLSI_INFO(sdev, "Received DEAUTH, reason = %d\n", reason);
$(CONFIG_SCSC_WLAN_MODULE)-y += ../cac.o
$(CONFIG_SCSC_WLAN_MODULE)-y += ../ioctl.o
$(CONFIG_SCSC_WLAN_MODULE)-y += ../traffic_monitor.o
+$(CONFIG_SCSC_WLAN_MODULE)-y += ../reg_info.o
# enable GSCAN
ifeq ($(CONFIG_SCSC_WLAN_GSCAN_ENABLE),y)
$(CONFIG_SCSC_WLAN_MODULE)-y += ../nl80211_vendor.o
void slsi_sm_wlan_service_close(struct slsi_dev *sdev)
{
}
+int slsi_sm_recovery_service_stop(struct slsi_dev *sdev)
+{
+ return 0;
+}
+int slsi_sm_recovery_service_close(struct slsi_dev *sdev)
+{
+ return 0;
+}
#define PANIC_RECORD_SIZE 64
+#define PANIC_STACK_RECORD_SIZE 256
#define PANIC_RECORD_DUMP_BUFFER_SZ 4096
/* WARNING: THIS IS INTERRUPT CONTEXT!
#define SCSC_RELEASE_PRODUCT 10
-#define SCSC_RELEASE_ITERATION 15
+#define SCSC_RELEASE_ITERATION 16
#define SCSC_RELEASE_CANDIDATE 0
#define SCSC_RELEASE_POINT 0