69 const u8 *signal,
int signal_len,
83 if ((signal ==
NULL) || (signal_len <= 0)) {
95 if (priv->smepriv ==
NULL) {
96 unifi_error(priv,
"sme_log_event: invalid smepriv\n");
102 "sme_log_event: Process signal 0x%.4X\n",
149 u8 pmBit = (frmCtrl & 0x1000)?0x01:0x00;
152 if((srcStaInfo !=
NULL) && (uf_check_broadcast_bssid(priv, bulkdata)==
FALSE))
154 uf_process_pm_bit_for_peer(priv,srcStaInfo,pmBit,interfaceTag);
157 srcStaInfo->activity_flag =
TRUE;
173 unifi_error(priv,
"Bad MA_PACKET_CONFIRM interfaceTag %d\n", interfaceTag);
181 #ifdef CSR_SUPPORT_SME
186 uf_process_ma_pkt_cfm_for_ap(priv ,interfaceTag, cfm);
199 #ifdef CSR_SUPPORT_SME
228 mlmeCommand.
length = signal_len;
229 mlmeCommand.
data = (
u8*)signal;
232 if (dataref1.
length > 0) {
240 if (dataref2.
length > 0) {
278 unifi_error(priv,
"uf_sme_port_state: bad interfaceTag\n");
285 port = &interfacePriv->controlled_data_port;
287 port = &interfacePriv->uncontrolled_data_port;
342 unifi_error(priv,
"uf_sme_port_config_handle: bad interfaceTag\n");
347 port = &interfacePriv->controlled_data_port;
349 port = &interfacePriv->uncontrolled_data_port;
362 unifi_trace(priv,
UDBG5,
"addr[0] = %x, addr[1] = %x, addr[2] = %x, addr[3] = %x\n", address[0], address[1], address[2], address[3]);
380 unifi_trace(priv,
UDBG5,
"port configuration not found, returning NULL (debug).\n");
388 multicast_list_task);
390 u16 interfaceTag = 0;
397 unifi_error(priv,
"uf_multicast_list_wq: bad interfaceTag\n");
402 "uf_multicast_list_wq: list count = %d\n",
409 mc_list = interfacePriv->
mc_list;
416 if (multicast_address_list ==
NULL) {
420 for (i = 0; i < mc_count; i++) {
425 if (priv->smepriv ==
NULL) {
426 kfree(multicast_address_list);
433 mc_count, multicast_address_list);
436 kfree(multicast_address_list);
447 unifi_error(priv,
"UNIFI_CFG: Failed to get the argument\n");
488 unifi_error(priv,
"UNIFI_CFG: Failed to get the argument\n");
495 unifi_error(priv,
"UNIFI_CFG: Get unifi_PowerConfigValue failed.\n");
499 switch (cfg_power_save) {
520 unifi_error(priv,
"UNIFI_CFG: Set unifi_PowerConfigValue failed.\n");
534 unifi_error(priv,
"UNIFI_CFG: Failed to get the argument\n");
541 unifi_error(priv,
"UNIFI_CFG: Get unifi_HostConfigValue failed.\n");
545 switch (cfg_power_supply) {
553 unifi_error(priv,
"POWERSUPPLY: Unknown value.\n");
559 unifi_error(priv,
"UNIFI_CFG: Set unifi_HostConfigValue failed.\n");
568 unsigned char *tclas_buffer;
569 unsigned int tclas_buffer_length;
574 if (priv->packet_filters.tclas_ies_length) {
575 kfree(priv->filter_tclas_ies);
576 priv->filter_tclas_ies =
NULL;
582 unifi_error(priv,
"UNIFI_CFG: Failed to get the filter struct\n");
586 tclas_buffer_length = priv->packet_filters.tclas_ies_length;
589 if (priv->packet_filters.dhcp_filter) {
590 priv->packet_filters.tclas_ies_length +=
sizeof(tclas_t);
592 if (priv->packet_filters.tclas_ies_length > 0) {
593 priv->filter_tclas_ies =
kmalloc(priv->packet_filters.tclas_ies_length,
GFP_KERNEL);
594 if (priv->filter_tclas_ies ==
NULL) {
597 if (tclas_buffer_length) {
601 tclas_buffer_length)) {
602 unifi_error(priv,
"UNIFI_CFG: Failed to get the TCLAS buffer\n");
608 if(priv->packet_filters.dhcp_filter)
611 dhcp_tclas = (tclas_t*)(priv->filter_tclas_ies + tclas_buffer_length);
612 memset(dhcp_tclas, 0,
sizeof(tclas_t));
613 dhcp_tclas->element_id = 14;
614 dhcp_tclas->length =
sizeof(tcpip_clsfr_t) + 1;
615 dhcp_tclas->user_priority = 0;
616 dhcp_tclas->tcp_ip_cls_fr.cls_fr_type = 1;
617 dhcp_tclas->tcp_ip_cls_fr.version = 4;
618 ((
u8*)(&dhcp_tclas->tcp_ip_cls_fr.source_port))[0] = 0x00;
619 ((
u8*)(&dhcp_tclas->tcp_ip_cls_fr.source_port))[1] = 0x44;
620 ((
u8*)(&dhcp_tclas->tcp_ip_cls_fr.dest_port))[0] = 0x00;
621 ((
u8*)(&dhcp_tclas->tcp_ip_cls_fr.dest_port))[1] = 0x43;
622 dhcp_tclas->tcp_ip_cls_fr.protocol = 0x11;
623 dhcp_tclas->tcp_ip_cls_fr.cls_fr_mask = 0x58;
638 unifi_error(priv,
"UNIFI_CFG: Failed to get the argument\n");
643 priv->connection_config.wmmQosInfo = wmm_qos_info;
661 unifi_error(priv,
"unifi_cfg_wmm_addts: Failed to get the argument\n");
665 addts_params +=
sizeof(
u32);
666 if (
get_user(addts_ie_length, (
u8*)addts_params)) {
667 unifi_error(priv,
"unifi_cfg_wmm_addts: Failed to get the argument\n");
672 addts_tid, addts_ie_length);
675 if (addts_ie ==
NULL) {
677 "unifi_cfg_wmm_addts: Failed to malloc %d bytes for addts_ie buffer\n",
682 addts_params +=
sizeof(
u8);
685 unifi_error(priv,
"unifi_cfg_wmm_addts: Failed to get the addts buffer\n");
690 tspec.
data = addts_ie;
691 tspec.
length = addts_ie_length;
713 unifi_error(priv,
"unifi_cfg_wmm_delts: Failed to get the argument\n");
731 u8 *strict_draft_n_params;
738 if (
get_user(strict_draft_n, (
u8*)strict_draft_n_params)) {
739 unifi_error(priv,
"unifi_cfg_strict_draft_n: Failed to get the argument\n");
743 unifi_trace(priv,
UDBG4,
"strict_draft_n: = %s\n", ((strict_draft_n) ?
"yes":
"no"));
748 unifi_warning(priv,
"unifi_cfg_strict_draft_n: Get unifi_SMEConfigValue failed.\n");
756 unifi_warning(priv,
"unifi_cfg_strict_draft_n: Set unifi_SMEConfigValue failed.\n");
767 u8 *enable_okc_params;
774 if (
get_user(enable_okc, (
u8*)enable_okc_params)) {
775 unifi_error(priv,
"unifi_cfg_enable_okc: Failed to get the argument\n");
779 unifi_trace(priv,
UDBG4,
"enable_okc: = %s\n", ((enable_okc) ?
"yes":
"no"));
783 unifi_warning(priv,
"unifi_cfg_enable_okc: Get unifi_SMEConfigValue failed.\n");
791 unifi_warning(priv,
"unifi_cfg_enable_okc: Set unifi_SMEConfigValue failed.\n");
806 unifi_error(priv,
"UNIFI_CFG: Failed to get the argument\n");
817 unifi_error(priv,
"UNIFI_CFG: Get unifi_CoexInfoValue failed.\n");
825 unifi_error(priv,
"UNIFI_CFG: Failed to copy the coex info\n");
835 unifi_error(priv,
"UNIFI_CFG: Get unifi_PowerConfigValue failed.\n");
843 unifi_error(priv,
"UNIFI_CFG: Failed to copy the power save info\n");
853 unifi_error(priv,
"UNIFI_CFG: Get unifi_HostConfigValue failed.\n");
861 unifi_error(priv,
"UNIFI_CFG: Failed to copy the host power mode\n");
876 sizeof(inst_name))) {
877 unifi_error(priv,
"UNIFI_CFG: Failed to copy the instance name\n");
885 #ifdef CSR_SUPPORT_WEXT_AP
887 cfg_ap_config.
channel = priv->ap_config.channel;
888 cfg_ap_config.
beaconInterval = priv->ap_mac_config.beaconInterval;
889 cfg_ap_config.
wmmEnabled = priv->ap_mac_config.wmmEnabled;
890 cfg_ap_config.
dtimPeriod = priv->ap_mac_config.dtimPeriod;
895 unifi_error(priv,
"UNIFI_CFG: Failed to copy the AP configuration\n");
906 unifi_error(priv,
"unifi_cfg_get_info: Unknown value.\n");
912 #ifdef CSR_SUPPORT_WEXT_AP
914 uf_configure_supported_rates(
u8 * supportedRates,
u8 phySupportedBitmap)
922 supportedRates[i++]=0x82;
923 supportedRates[i++]=0x84;
924 supportedRates[i++]=0x8b;
925 supportedRates[i++]=0x96;
928 supportedRates[i++]=0x02;
929 supportedRates[i++]=0x04;
930 supportedRates[i++]=0x0b;
931 supportedRates[i++]=0x16;
932 supportedRates[i++]=0x0c;
933 supportedRates[i++]=0x12;
934 supportedRates[i++]=0x18;
935 supportedRates[i++]=0x24;
936 supportedRates[i++]=0x30;
937 supportedRates[i++]=0x48;
938 supportedRates[i++]=0x60;
939 supportedRates[i++]=0x6c;
943 supportedRates[i++]=0x8c;
944 supportedRates[i++]=0x98;
945 supportedRates[i++]=0xb0;
947 supportedRates[i++]=0x0c;
948 supportedRates[i++]=0x18;
949 supportedRates[i++]=0x30;
951 supportedRates[i++]=0x48;
952 supportedRates[i++]=0x12;
953 supportedRates[i++]=0x24;
954 supportedRates[i++]=0x60;
955 supportedRates[i++]=0x6c;
967 unifi_error(priv,
"UNIFI_CFG: Failed to get the ap config struct\n");
970 priv->ap_config.channel = cfg_ap_config.
channel;
971 priv->ap_mac_config.dtimPeriod = cfg_ap_config.
dtimPeriod;
972 priv->ap_mac_config.beaconInterval = cfg_ap_config.
beaconInterval;
973 priv->group_sec_config.apGroupkeyTimeout = cfg_ap_config.
groupkeyTimeout;
975 priv->group_sec_config.apGmkTimeout = cfg_ap_config.
gmkTimeout;
976 priv->group_sec_config.apResponseTimeout = cfg_ap_config.
responseTimeout;
977 priv->group_sec_config.apRetransLimit = cfg_ap_config.
retransLimit;
982 priv->ap_mac_config.wmmEnabled = cfg_ap_config.
wmmEnabled;
984 priv->ap_mac_config.apHtParams.rxStbc=cfg_ap_config.
rxStbc;
985 priv->ap_mac_config.apHtParams.rifsModeAllowed=cfg_ap_config.
rifsModeAllowed;
990 priv->ap_mac_config.supportedRatesCount= uf_configure_supported_rates(priv->ap_mac_config.supportedRates,priv->ap_mac_config.phySupportedBitmap);
996 #ifdef CSR_SUPPORT_WEXT
1011 unifi_warning(priv,
"uf_sme_config_wq: Get unifi_SMEConfigValue failed.\n");
1024 "SME config for 802.11d Trust Level and Radio Band failed.\n");
1057 u16 interfaceTag = 0;
1094 u16 interfaceTag = 0;
1159 unsigned long flags;
1166 spin_unlock_irqrestore(&priv->
m4_lock, flags);
1178 #if (defined(CSR_WIFI_SECURITY_WAPI_ENABLE) && defined(CSR_WIFI_SECURITY_WAPI_SW_ENCRYPTION))
1195 void uf_send_pkt_to_encrypt(
struct work_struct *work)
1201 u32 pktBulkDataLength;
1203 unsigned long flags;
1209 pktBulkDataLength = interfacePriv->wapi_unicast_bulk_data.data_length;
1211 if (pktBulkDataLength > 0) {
1213 memset(pktBulkData, 0, pktBulkDataLength);
1215 unifi_error(priv,
"uf_send_pkt_to_encrypt() : invalid buffer\n");
1221 memcpy(pktBulkData, (
u8*)interfacePriv->wapi_unicast_bulk_data.os_data_ptr, pktBulkDataLength);
1224 interfacePriv->wapi_unicast_bulk_data.net_buf_length = 0;
1225 interfacePriv->wapi_unicast_bulk_data.data_length = 0;
1226 interfacePriv->wapi_unicast_bulk_data.os_data_ptr = interfacePriv->wapi_unicast_bulk_data.os_net_buf_ptr =
NULL;
1227 spin_unlock_irqrestore(&priv->wapi_lock, flags);