previous_suspend_mode = sdev->device_config.user_suspend_mode;
SLSI_MUTEX_UNLOCK(sdev->device_config_mutex);
- SLSI_DBG3(sdev, SLSI_CFG80211, "user_suspend_mode:%d, previous_suspend_mode:%d\n",
- user_suspend_mode, previous_suspend_mode);
-
if (user_suspend_mode != previous_suspend_mode) {
SLSI_MUTEX_LOCK(sdev->netdev_add_remove_mutex);
for (vif = 1; vif <= CONFIG_SCSC_WLAN_MAX_INTERFACES; vif++) {
int readbyte = 0;
int result = 0;
- SLSI_NET_DBG2(dev, SLSI_CFG80211, "Function entry\n");
-
p2p_oppps_param = command + strlen(CMD_P2PSETPS) + 1;
ndev_vif = netdev_priv(dev);
SLSI_MUTEX_LOCK(ndev_vif->vif_mutex);
goto exit;
}
- if (opp_ps == 0) {
- SLSI_DBG1(sdev, SLSI_CFG80211, "p2p opp_ps = %d\n", opp_ps);
+ if (opp_ps == 0)
result = slsi_mlme_set_ctwindow(sdev, dev, opp_ps);
- } else if (ct_param < (unsigned int)ndev_vif->ap.beacon_interval) {
- SLSI_DBG1(sdev, SLSI_CFG80211, "p2p ct window = %d\n", ct_param);
+ else if (ct_param < (unsigned int)ndev_vif->ap.beacon_interval)
result = slsi_mlme_set_ctwindow(sdev, dev, ct_param);
- } else {
+ else
SLSI_DBG1(sdev, SLSI_CFG80211, "p2p ct window = %d is out of range for beacon interval(%d)\n", ct_param, ndev_vif->ap.beacon_interval);
- }
exit:
SLSI_MUTEX_UNLOCK(ndev_vif->vif_mutex);
unsigned int duration;
unsigned int interval;
- SLSI_NET_DBG4(dev, SLSI_NETDEV, "Function entry\n");
-
noa_params = command + strlen(CMD_P2PSETNOA) + 1;
ndev_vif = netdev_priv(dev);
SLSI_MUTEX_LOCK(ndev_vif->vif_mutex);
}
/* Skip start time */
-
- SLSI_DBG1(sdev, SLSI_CFG80211, "p2p noa_params (count,interval,duration)= (%d,%d,%d)\n",
- noa_count, interval, duration);
result = slsi_mlme_set_p2p_noa(sdev, dev, noa_count, interval, duration);
exit:
goto exit;
}
offset = offset + readbyte + 1;
- SLSI_DBG1(sdev, SLSI_CFG80211, "p2p ecsa_params (channel and bandwidth)= (%d,%d)\n", channel, bandwidth);
-
band = (channel <= 14) ? NL80211_BAND_2GHZ : NL80211_BAND_5GHZ;
center_freq = ieee80211_channel_to_frequency(channel, band);
SLSI_DBG1(sdev, SLSI_CFG80211, "p2p ecsa_params (center_freq)= (%d)\n", center_freq);
#ifndef SSB_4963_FIXED
/* Default HT40 configuration */
if (sdev->band_5g_supported) {
- SLSI_DBG1(sdev, SLSI_CFG80211, "p2p ecsa_params Default HT40\n");
if (bandwidth == 80) {
chandef.width = NL80211_CHAN_WIDTH_40;
bandwidth = 40;
}
}
#endif
- SLSI_DBG1(sdev, SLSI_CFG80211, "p2p ecsa_params chan_type = %d\n", chan_type);
if (channel == 165 && bandwidth != 20) {
bandwidth = 20;
chan_type = NL80211_CHAN_HT20;
- SLSI_DBG3(sdev, SLSI_CFG80211, "downgrade bandwidth [from:%d to:20] on chan 165\n", bandwidth);
}
cfg80211_chandef_create(&chandef, chandef.chan, chan_type);
chan_info = slsi_get_chann_info(sdev, &chandef);
}
offset = offset + readbyte + 1;
params_len = params_len - offset;
- SLSI_NET_DBG2(dev, SLSI_NETDEV, "command = %s, frametype=%d, iftype = %d, total buf_len=%d, params_len=%d\n", command, frametype, iftype, buf_len, params_len);
/* check the net device interface type */
if (iftype == IF_TYPE_P2P_DEVICE) {
u8 *probe_resp_ie = NULL; /* params+offset; */
- SLSI_NET_DBG2(dev, SLSI_NETDEV, "P2P device case");
if (frametype != FRAME_TYPE_PROBE_RESPONSE) {
SLSI_NET_ERR(dev, "Wrong frame type received\n");
goto exit;
memcpy(probe_resp_ie, params+offset, params_len);
- SLSI_NET_DBG2(dev, SLSI_NETDEV, "P2P Device: probe_resp_ie is NOT NULL\n");
return slsi_p2p_dev_probe_rsp_ie(sdev, dev, probe_resp_ie, params_len);
} else if (iftype == IF_TYPE_P2P_INTERFACE) {
- SLSI_NET_DBG2(dev, SLSI_NETDEV, "P2P GO case");
- if (frametype == FRAME_TYPE_BEACON) {
- SLSI_DBG1(sdev, SLSI_MLME, "P2P GO beacon IEs update\n");
+ if (frametype == FRAME_TYPE_BEACON)
return slsi_p2p_go_vendor_ies_write(sdev, dev, params+offset, params_len, FAPI_PURPOSE_BEACON);
- } else if (frametype == FRAME_TYPE_PROBE_RESPONSE) {
- SLSI_DBG1(sdev, SLSI_MLME, "P2P GO proberesp IEs update\n");
+ else if (frametype == FRAME_TYPE_PROBE_RESPONSE)
return slsi_p2p_go_vendor_ies_write(sdev, dev, params+offset, params_len, FAPI_PURPOSE_PROBE_RESPONSE);
- } else if (frametype == FRAME_TYPE_ASSOC_RESPONSE) {
- SLSI_DBG1(sdev, SLSI_MLME, "P2P GO Association Response IEs update\n");
+ else if (frametype == FRAME_TYPE_ASSOC_RESPONSE)
return slsi_p2p_go_vendor_ies_write(sdev, dev, params+offset, params_len, FAPI_PURPOSE_ASSOCIATION_RESPONSE);
- }
}
exit:
return result;
goto exit;
}
- SLSI_NET_DBG2(dev, SLSI_CFG80211, "Start Listen Offloading\n");
-
lo_params = command + strlen(CMD_P2PLOSTART) + 1;
readbyte = slsi_str_to_int(&lo_params[offset], &channel);
if (!readbyte) {
SLSI_MUTEX_LOCK(ndev_vif->vif_mutex);
- SLSI_NET_DBG2(dev, SLSI_CFG80211, "Stop Listen Offloading\n");
-
WARN_ON((!ndev_vif->unsync.listen_offload) || (ndev_vif->sdev->p2p_state != P2P_LISTENING));
ndev_vif->unsync.listen_offload = false;
struct netdev_vif *ndev_swlan_vif;
swlan_dev = slsi_get_netdev(sdev, SLSI_NET_INDEX_P2PX_SWLAN);
- if (WARN_ON(swlan_dev))
+ if (swlan_dev) {
+ SLSI_NET_ERR(dev, "swlan already created\n");
return -EINVAL;
+ }
swlan_dev = slsi_new_interface_create(sdev->wiphy, intf_name, NL80211_IFTYPE_AP, NULL);
if (swlan_dev) {
SLSI_MUTEX_LOCK(ndev_swlan_vif->vif_mutex);
ndev_swlan_vif->wifi_sharing = true;
SLSI_MUTEX_UNLOCK(ndev_swlan_vif->vif_mutex);
- SLSI_DBG1_NODEV(SLSI_MLME, "Interface %s created successfully\n", intf_name);
return 0;
}
+ SLSI_NET_ERR(dev, "Failed to create interface %s\n", intf_name);
return -EINVAL;
}
slsi_stop_net_dev(sdev, dev);
slsi_netif_remove_rtlnl_locked(sdev, dev);
- SLSI_DBG1_NODEV(SLSI_MLME, "Interface %s deleted successfully\n", intf_name);
-
return 0;
}
int ret;
readbyte = slsi_str_to_int(&arg[offset], &res);
- SLSI_DBG1_NODEV(SLSI_MLME, "SET_INDOOR_CHANNELS : %s\n", arg);
ret = slsi_set_mib_wifi_sharing_5ghz_channel(sdev, SLSI_PSID_UNIFI_WI_FI_SHARING5_GHZ_CHANNEL,
res, offset, readbyte, arg);
int mib_value = 0;
slsi_str_to_int(command, &mib_value);
- SLSI_DBG1_NODEV(SLSI_MLME, "Setting to: %d", mib_value);
return slsi_set_mib_roam(sdev, NULL, SLSI_PSID_UNIFI_RSSI_ROAM_SCAN_TRIGGER, mib_value);
}
int mib_value = 0;
slsi_str_to_int(command, &mib_value);
- SLSI_DBG1_NODEV(SLSI_MLME, "Setting to: %d", mib_value);
return slsi_set_mib_roam(sdev, NULL, SLSI_PSID_UNIFI_ROAM_DELTA_TRIGGER, mib_value);
}
int mib_value = 0;
slsi_str_to_int(command, &mib_value);
- SLSI_DBG1_NODEV(SLSI_MLME, "Setting to: %d", mib_value);
-
return slsi_set_mib_roam(sdev, NULL, SLSI_PSID_UNIFI_ROAM_CACHED_CHANNEL_SCAN_PERIOD, mib_value * 1000000);
}
int mib_value = 0;
slsi_str_to_int(command, &mib_value);
- SLSI_DBG1_NODEV(SLSI_MLME, "Setting to: %d", mib_value);
return slsi_set_mib_roam(sdev, NULL, SLSI_PSID_UNIFI_FULL_ROAM_SCAN_PERIOD, mib_value * 1000000);
}
int mib_value = 0;
slsi_str_to_int(command, &mib_value);
- SLSI_DBG1_NODEV(SLSI_MLME, "Setting to: %d", mib_value);
return slsi_set_mib_roam(sdev, NULL, SLSI_PSID_UNIFI_ROAM_SCAN_MAX_ACTIVE_CHANNEL_TIME, mib_value);
}
int mib_value = 0;
slsi_str_to_int(command, &mib_value);
- SLSI_DBG1_NODEV(SLSI_MLME, "Setting to: %d", mib_value);
-
return slsi_set_mib_roam(sdev, NULL, SLSI_PSID_UNIFI_ROAM_SCAN_NPROBE, mib_value);
}
}
slsi_str_to_int(command, &mib_value);
- SLSI_DBG1_NODEV(SLSI_MLME, "Setting to: %d", mib_value);
return slsi_set_mib_roam(sdev, NULL, SLSI_PSID_UNIFI_ROAM_MODE, mib_value);
}
* each mac address id 17 bytes and every mac address is separated by ','
*/
buf_pos = slsi_str_to_int(command, &ap_count);
- SLSI_DBG1_NODEV(SLSI_MLME, "ap_count: %d\n", ap_count);
if (ap_count < ROAMOFFLAPLIST_MIN || ap_count > ROAMOFFLAPLIST_MAX) {
SLSI_ERR(sdev, "ap_count: %d\n", ap_count);
return -EINVAL;
int mib_value = 0;
slsi_str_to_int(command, &mib_value);
- SLSI_DBG1_NODEV(SLSI_MLME, "Setting to: %d", mib_value);
-
return slsi_set_mib_roam(sdev, NULL, SLSI_PSID_UNIFI_ROAM_SCAN_BAND, mib_value);
}
int mib_value = 0;
slsi_str_to_int(command, &mib_value);
- SLSI_DBG1_NODEV(SLSI_MLME, "Setting to: %d", mib_value);
return slsi_set_mib_roam(sdev, NULL, SLSI_PSID_UNIFI_ROAM_SCAN_HOME_TIME, mib_value);
}
int mib_value = 0;
slsi_str_to_int(command, &mib_value);
- SLSI_DBG1_NODEV(SLSI_MLME, "Setting to: %d", mib_value);
-
return slsi_set_mib_roam(sdev, NULL, SLSI_PSID_UNIFI_ROAM_SCAN_HOME_AWAY_TIME, mib_value);
}
SLSI_MUTEX_LOCK(sdev->device_config_mutex);
ap_auto_chan = sdev->device_config.ap_auto_chan;
- SLSI_INFO(sdev, "Auto channel selected: %d\n", ap_auto_chan);
SLSI_MUTEX_UNLOCK(sdev->device_config_mutex);
result = snprintf(command, buf_len, "%d\n", ap_auto_chan);
return -EINVAL;
}
- SLSI_DBG3(sdev, SLSI_CFG80211, "n_channels:%d\n", n_channels);
if (n_channels > SLSI_NO_OF_SCAN_CHANLS_FOR_AUTO_CHAN_MAX) {
SLSI_ERR(sdev, "channel count:%d > SLSI_NO_OF_SCAN_CHANLS_FOR_AUTO_CHAN_MAX:%d\n", n_channels, SLSI_NO_OF_SCAN_CHANLS_FOR_AUTO_CHAN_MAX);
return -EINVAL;
n_channels = 14;
else if (n_channels == 2)
n_channels = 9;
- SLSI_DBG3(sdev, SLSI_INIT_DEINIT, "Number of channels to scan = %d", n_channels);
-
count_channels = 0;
for (chan = 1; chan <= n_channels; chan++) {
int center_freq;
else
count_channels++;
- SLSI_DBG3(sdev, SLSI_INIT_DEINIT, "channels[%d]:%d\n", count_channels, chan);
}
SLSI_DBG3(sdev, SLSI_INIT_DEINIT, "Number of channels for autchannel selection= %d", count_channels);
command[17] = '\0';
slsi_machexstring_to_macarray(command, bssid);
- SLSI_DBG1_NODEV(SLSI_MLME, "ROAM BSSID '%pM'\n", bssid);
if (!slsi_str_to_int(&command[18], &channel)) {
SLSI_ERR(sdev, "Invalid channel string: '%s'\n", &command[18]);
return -EINVAL;
}
- SLSI_DBG1_NODEV(SLSI_MLME, "ROAM to channel '%d'\n", channel);
-
if (channel > 14)
band = NL80211_BAND_5GHZ;
freq = (u16)ieee80211_channel_to_frequency(channel, band);
slsi_machexstring_to_macarray(command, bssid);
command[17] = ' ';
- SLSI_DBG1_NODEV(SLSI_MLME, "BSSID '%pM'\n", bssid);
-
pos = strchr(command, ' ');
if (pos == NULL)
return -EINVAL;
band = NL80211_BAND_5GHZ;
freq = (u16)ieee80211_channel_to_frequency(channel, band);
- SLSI_DBG1_NODEV(SLSI_MLME, "freq %d\n", freq);
-
pos = strchr(pos, ' ');
if (pos == NULL)
return -EINVAL;
struct slsi_mib_data mib_data = { 0, NULL };
int result = 0;
- SLSI_INFO(sdev, "Setting max_num_sta to %d\n", sta_number);
-
if (sta_number > 10 || sta_number < 1)
return -EINVAL;
result = slsi_mib_encode_uint(&mib_data, SLSI_PSID_UNIFI_MAX_CLIENT, sta_number, 0);
chan_info = 20; /* Hardcoded to 20MHz as cert tests use BSS with 20MHz */
}
- SLSI_NET_DBG2(dev, SLSI_TDLS, "ch_switch(%d) mac[%pM] freq(%d) chan_info(0x%02x)\n", is_ch_switch, peer_mac, center_freq, chan_info);
-
peer = slsi_get_peer_from_mac(sdev, dev, peer_mac);
if (!peer || !slsi_is_tdls_peer(dev, peer)) {
u8 host_state;
(void)slsi_str_to_int(command, &mode);
- SLSI_DBG1(sdev, SLSI_MLME, "Mode:%d\n", mode);
-
SLSI_MUTEX_LOCK(sdev->device_config_mutex);
host_state = sdev->device_config.host_state;
u8 host_state;
max_power_ena = (cmd[0] == '0');
- SLSI_DBG3(sdev, SLSI_NETDEV, "max_power_ena :%d\n", max_power_ena);
-
SLSI_MUTEX_LOCK(sdev->device_config_mutex);
host_state = sdev->device_config.host_state;
else
enable = 0;
- SLSI_DBG3(sdev, SLSI_NETDEV, "FAKE MAC :%d\n", enable);
-
status = slsi_mib_encode_bool(&mib_data, SLSI_PSID_UNIFI_MAC_ADDRESS_RANDOMISATION, enable, 0);
if (status != SLSI_MIB_STATUS_SUCCESS) {
SLSI_ERR(sdev, "FAKE MAC FAIL: no mem for MIB\n");
}
command[priv_cmd.total_len] = '\0';
+ SLSI_NET_DBG3(dev, SLSI_CFG80211, "command: %.*s, total_len in priv_cmd = %d\n", priv_cmd.total_len, command, priv_cmd.total_len);
+
if (strncasecmp(command, CMD_SETSUSPENDMODE, strlen(CMD_SETSUSPENDMODE)) == 0) {
ret = slsi_set_suspend_mode(dev, command);
} else if (strncasecmp(command, CMD_SETJOINPREFER, strlen(CMD_SETJOINPREFER)) == 0) {
(strncasecmp(command, CMD_SETCCXMODE, strlen(CMD_SETCCXMODE)) == 0) ||
(strncasecmp(command, CMD_SETDFSSCANMODE, strlen(CMD_SETDFSSCANMODE)) == 0) ||
(strncasecmp(command, CMD_SETSINGLEANT, strlen(CMD_SETSINGLEANT)) == 0)) {
- SLSI_NET_DBG3(dev, SLSI_CFG80211, "known command %s - no handler\n", command);
ret = -ENOTSUPP;
#ifndef SLSI_TEST_DEV
} else if (strncasecmp(command, CMD_DRIVERDEBUGDUMP, strlen(CMD_DRIVERDEBUGDUMP)) == 0) {
#endif
#endif
} else {
- SLSI_NET_ERR(dev, "Not Supported : %.*s\n", priv_cmd.total_len, command);
ret = -ENOTSUPP;
}
if (strncasecmp(command, CMD_SETROAMBAND, strlen(CMD_SETROAMBAND)) != 0 && strncasecmp(command, CMD_SETBAND, strlen(CMD_SETBAND)) != 0 && copy_to_user(priv_cmd.buf, command, priv_cmd.total_len)) {
5745, 5765, 5785, 5805, 5825 };
#endif
-#define SLSI_CHECK_TYPE(sdev, recv_type, exp_type) \
- do { \
- int var1 = recv_type; \
- int var2 = exp_type; \
- if (var1 != var2) { \
- SLSI_WARN(sdev, "expected type: %d and received type %d ", var2, var1); \
- } \
- } while (0)
-
void slsi_purge_scan_results_locked(struct netdev_vif *ndev_vif, u16 scan_id)
{
struct slsi_scan_result *scan_result;
}
if (values[mib_index].type != SLSI_MIB_TYPE_NONE) { /* CHIP_VERSION */
- WARN_ON(values[mib_index].type != SLSI_MIB_TYPE_UINT);
+ SLSI_CHECK_TYPE(sdev, values[mib_index].type, SLSI_MIB_TYPE_UINT);
sdev->chip_info_mib.chip_version = values[mib_index].u.uintValue;
}
if (values[++mib_index].type != SLSI_MIB_TYPE_NONE) { /* SUPPORTED_CHANNELS */
- WARN_ON(values[mib_index].type != SLSI_MIB_TYPE_OCTET);
+ SLSI_CHECK_TYPE(sdev, values[mib_index].type, SLSI_MIB_TYPE_OCTET);
if (values[mib_index].type == SLSI_MIB_TYPE_OCTET) {
sdev->band_5g_supported = 0;
memset(sdev->supported_2g_channels, 0, sizeof(sdev->supported_2g_channels));
SLSI_WARN(sdev, "Error reading 2g 40mhz enabled mib\n");
if (values[++mib_index].type != SLSI_MIB_TYPE_NONE) { /* HARDWARE_PLATFORM */
- WARN_ON(values[mib_index].type != SLSI_MIB_TYPE_UINT);
+ SLSI_CHECK_TYPE(sdev, values[mib_index].type, SLSI_MIB_TYPE_UINT);
sdev->plat_info_mib.plat_build = values[mib_index].u.uintValue;
} else {
SLSI_WARN(sdev, "Error reading Hardware platform\n");
}
if (values[0].type != SLSI_MIB_TYPE_NONE) {
- WARN_ON(values[0].type != SLSI_MIB_TYPE_UINT);
+ SLSI_CHECK_TYPE(sdev, values[0].type, SLSI_MIB_TYPE_UINT);
cap->max_scan_buckets = values[0].u.uintValue;
}
if (values[1].type != SLSI_MIB_TYPE_NONE) {
- WARN_ON(values[1].type != SLSI_MIB_TYPE_UINT);
+ SLSI_CHECK_TYPE(sdev, values[1].type, SLSI_MIB_TYPE_UINT);
cap->max_rssi_sample_size = values[1].u.uintValue;
}
if (values[2].type != SLSI_MIB_TYPE_NONE) {
- WARN_ON(values[2].type != SLSI_MIB_TYPE_UINT);
+ SLSI_CHECK_TYPE(sdev, values[2].type, SLSI_MIB_TYPE_UINT);
cap->max_hotlist_aps = values[2].u.uintValue;
}
if (values[3].type != SLSI_MIB_TYPE_NONE) {
- WARN_ON(values[3].type != SLSI_MIB_TYPE_UINT);
+ SLSI_CHECK_TYPE(sdev, values[3].type, SLSI_MIB_TYPE_UINT);
cap->max_significant_wifi_change_aps = values[3].u.uintValue;
}
if (values[4].type != SLSI_MIB_TYPE_NONE) {
- WARN_ON(values[4].type != SLSI_MIB_TYPE_UINT);
+ SLSI_CHECK_TYPE(sdev, values[4].type, SLSI_MIB_TYPE_UINT);
cap->max_bssid_history_entries = values[4].u.uintValue;
}
return -EINVAL;
}
if (values[0].type != SLSI_MIB_TYPE_NONE) { /* LAST_PEER_BANDWIDTH */
- WARN_ON(values[0].type != SLSI_MIB_TYPE_INT);
+ SLSI_CHECK_TYPE(sdev, values[0].type, SLSI_MIB_TYPE_INT);
ndev_vif->ap.last_disconnected_sta.bandwidth = values[0].u.intValue;
}
if (values[1].type != SLSI_MIB_TYPE_NONE) { /*LAST_PEER_NSS*/
- WARN_ON(values[1].type != SLSI_MIB_TYPE_INT);
+ SLSI_CHECK_TYPE(sdev, values[1].type, SLSI_MIB_TYPE_INT);
ndev_vif->ap.last_disconnected_sta.antenna_mode = values[1].u.intValue;
}
if (values[2].type != SLSI_MIB_TYPE_NONE) { /* LAST_PEER_RSSI*/
- WARN_ON(values[2].type != SLSI_MIB_TYPE_INT);
+ SLSI_CHECK_TYPE(sdev, values[2].type, SLSI_MIB_TYPE_INT);
ndev_vif->ap.last_disconnected_sta.rssi = values[2].u.intValue;
}
if (values[3].type != SLSI_MIB_TYPE_NONE) { /* LAST_PEER_TX_DATA_RATE */
- WARN_ON(values[3].type != SLSI_MIB_TYPE_UINT);
+ SLSI_CHECK_TYPE(sdev, values[3].type, SLSI_MIB_TYPE_UINT);
fw_tx_rate = values[3].u.uintValue;
slsi_fw_tx_rate_calc(fw_tx_rate, NULL,
(unsigned long *)&ndev_vif->ap.last_disconnected_sta.tx_data_rate);