[NEUS7920-849][9610][7885] wlbt: NAN R1 fapi7 updates
authorJaya Prakash Sangaru <j.sangaru@samsung.com>
Thu, 16 May 2019 14:06:20 +0000 (19:36 +0530)
committerlingsen1 <lingsen1@lenovo.com>
Fri, 14 Jun 2019 13:25:20 +0000 (21:25 +0800)
NAN R1 FAPI7 updates

Change-Id: I78bad40292bfbdaced444db1b667e162376585b1
SCSC-Bug-Id: SSB-52785
Signed-off-by: Jaya Prakash Sangaru <j.sangaru@samsung.com>
drivers/net/wireless/scsc/mlme.c
drivers/net/wireless/scsc/mlme_nan.c
drivers/net/wireless/scsc/nl80211_vendor_nan.c
drivers/net/wireless/scsc/nl80211_vendor_nan.h

index 3cdca45f702903d24cfc1f0ec833c61a531aeb2d..3c66640361b81600da55f9e69162b2872c1744ab 100755 (executable)
 #define SLSI_NOA_CONFIG_REQUEST_ID          (1)
 #define SLSI_MLME_ARP_DROP_FREE_SLOTS_COUNT 16
 
-#define SLSI_FAPI_NAN_ATTRIBUTE_PUT_U8(req, attribute, val) \
-{ \
-       u16 attribute_len = 1; \
-       struct sk_buff *req_p = req; \
-       fapi_append_data((req_p), (u8 *)&(attribute), 2); \
-       fapi_append_data((req_p), (u8 *)&attribute_len, 2); \
-       fapi_append_data((req_p), (u8 *)&(val), 1); \
-}
-
-#define SLSI_FAPI_NAN_ATTRIBUTE_PUT_U16(req, attribute, val) \
-{ \
-       u16 attribute_len = 2; \
-       __le16 le16val = cpu_to_le16(val); \
-       struct sk_buff *req_p = req; \
-       fapi_append_data((req_p), (u8 *)&(attribute), 2); \
-       fapi_append_data((req_p), (u8 *)&attribute_len, 2); \
-       fapi_append_data((req_p), (u8 *)&le16val, 2); \
-}
-
-#define SLSI_FAPI_NAN_ATTRIBUTE_PUT_U32(req, attribute, val) \
-{ \
-       u16 attribute_len = 4; \
-       __le32 le32val = cpu_to_le32(val);\
-       struct sk_buff *req_p = req; \
-       fapi_append_data((req_p), (u8 *)&(attribute), 2); \
-       fapi_append_data((req_p), (u8 *)&attribute_len, 2); \
-       fapi_append_data((req_p), (u8 *)&le32val, 4); \
-}
-
-#define SLSI_FAPI_NAN_ATTRIBUTE_PUT_DATA(req, attribute, val, val_len) \
-{ \
-       u16 attribute_len = (val_len); \
-       struct sk_buff *req_p = req; \
-       fapi_append_data((req_p), (u8 *)&(attribute), 2); \
-       fapi_append_data((req_p), (u8 *)&attribute_len, 2); \
-       fapi_append_data((req_p), (val), (attribute_len)); \
-}
-
 static bool missing_cfm_ind_panic = true;
 module_param(missing_cfm_ind_panic, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(missing_cfm_ind_panic, "Panic on missing confirm or indication from the chip");
index fbe13d1f1ff7a438dc01872d59cb8728d98527df..5e58f7d0f25b02de3fa05f4219cb6cb985384ade 100755 (executable)
 
 static void slsi_mlme_nan_enable_fapi_data(struct sk_buff *req, struct slsi_hal_nan_enable_req *hal_req)
 {
-       u8  nan_config_fields_header[] = {0xdd, 0x00, 0x00, 0x16, 0x32, 0x0b, 0x01};
-       u8 *header_ptr;
-       u16 attribute;
-       u8  band_usage = BIT(0) | BIT(1);
-       u8  scan_param[] = {0, 0, 0};
-       int len = 0;
-
-       header_ptr = fapi_append_data(req, nan_config_fields_header, sizeof(nan_config_fields_header));
-       len += sizeof(nan_config_fields_header);
-
-       if (hal_req->config_2dot4g_beacons && !hal_req->beacon_2dot4g_val)
-               band_usage &= ~BIT(0);
-       if (hal_req->config_2dot4g_sdf && !hal_req->sdf_2dot4g_val)
-               band_usage &= ~BIT(1);
-       if (hal_req->config_5g_beacons && hal_req->beacon_5g_val)
-               band_usage |= BIT(2);
-       if (hal_req->config_5g_sdf && hal_req->sdf_5g_val)
-               band_usage |= BIT(3);
-
-       attribute = SLSI_FAPI_NAN_CONFIG_PARAM_BAND_USAGE;
-       SLSI_FAPI_NAN_ATTRIBUTE_PUT_U8(req, attribute, band_usage);
-       attribute = SLSI_FAPI_NAN_CONFIG_PARAM_MASTER_PREFERENCE;
-       SLSI_FAPI_NAN_ATTRIBUTE_PUT_U16(req, attribute, hal_req->master_pref);
-       len += 11; /* 5 for band_usage, 6 for master preference */
-
-       if (hal_req->config_sid_beacon) {
-               attribute = SLSI_FAPI_NAN_CONFIG_PARAM_SID_BEACON;
-               SLSI_FAPI_NAN_ATTRIBUTE_PUT_U8(req, attribute, hal_req->sid_beacon_val);
-               len += 5;
-       }
-
-       if (hal_req->config_2dot4g_rssi_close) {
-               attribute = SLSI_FAPI_NAN_CONFIG_PARAM_2_4_RSSI_CLOSE;
-               SLSI_FAPI_NAN_ATTRIBUTE_PUT_U8(req, attribute, hal_req->rssi_close_2dot4g_val);
-               len += 5;
-       }
-
-       if (hal_req->config_2dot4g_rssi_middle) {
-               attribute = SLSI_FAPI_NAN_CONFIG_PARAM_2_4_RSSI_MIDDLE;
-               SLSI_FAPI_NAN_ATTRIBUTE_PUT_U8(req, attribute, hal_req->rssi_middle_2dot4g_val);
-               len += 5;
-       }
-
-       if (hal_req->config_2dot4g_rssi_proximity) {
-               attribute = SLSI_FAPI_NAN_CONFIG_PARAM_2_4_RSSI_PROXIMITY;
-               SLSI_FAPI_NAN_ATTRIBUTE_PUT_U8(req, attribute, hal_req->rssi_proximity_2dot4g_val);
-               len += 5;
-       }
-
-       if (hal_req->config_5g_rssi_close) {
-               attribute = SLSI_FAPI_NAN_CONFIG_PARAM_5_RSSI_CLOSE;
-               SLSI_FAPI_NAN_ATTRIBUTE_PUT_U8(req, attribute, hal_req->rssi_close_5g_val);
-               len += 5;
-       }
-
-       if (hal_req->config_5g_rssi_middle) {
-               attribute = SLSI_FAPI_NAN_CONFIG_PARAM_5_RSSI_MIDDLE;
-               SLSI_FAPI_NAN_ATTRIBUTE_PUT_U8(req, attribute, hal_req->rssi_middle_5g_val);
-               len += 5;
-       }
-
-       if (hal_req->config_5g_rssi_close_proximity) {
-               attribute = SLSI_FAPI_NAN_CONFIG_PARAM_5_RSSI_PROXIMITY;
-               SLSI_FAPI_NAN_ATTRIBUTE_PUT_U8(req, attribute, hal_req->rssi_close_proximity_5g_val);
-               len += 5;
-       }
-
-       if (hal_req->config_hop_count_limit) {
-               attribute = SLSI_FAPI_NAN_CONFIG_PARAM_HOP_COUNT_LIMIT;
-               SLSI_FAPI_NAN_ATTRIBUTE_PUT_U8(req, attribute, hal_req->hop_count_limit_val);
-               len += 5;
-       }
-
-       if (hal_req->config_rssi_window_size) {
-               attribute = SLSI_FAPI_NAN_CONFIG_PARAM_RSSI_WINDOW_SIZE;
-               SLSI_FAPI_NAN_ATTRIBUTE_PUT_U8(req, attribute, hal_req->rssi_window_size_val);
-               len += 5;
-       }
-
-       if (hal_req->config_scan_params) {
-               attribute = SLSI_FAPI_NAN_CONFIG_PARAM_SCAN_PARAMETER_2_4;
-               scan_param[0] = hal_req->scan_params_val.dwell_time[0];
-               scan_param[1] = hal_req->scan_params_val.scan_period[0] & 0x00FF;
-               scan_param[2] = (hal_req->scan_params_val.scan_period[0] & 0xFF00) >> 8;
-               SLSI_FAPI_NAN_ATTRIBUTE_PUT_DATA(req, attribute, scan_param, 3);
-               attribute = SLSI_FAPI_NAN_CONFIG_PARAM_SCAN_PARAMETER_5;
-               scan_param[0] = hal_req->scan_params_val.dwell_time[1];
-               scan_param[1] = hal_req->scan_params_val.scan_period[1] & 0x00FF;
-               scan_param[2] = (hal_req->scan_params_val.scan_period[1] & 0xFF00) >> 8;
-               SLSI_FAPI_NAN_ATTRIBUTE_PUT_DATA(req, attribute, scan_param, 3);
-               len += 7 * 2;
-       }
-
-       /* update len */
-       header_ptr[1] = len - 2;
+       u8  nan_config_fields_header[] = {0xdd, 0x24, 0x00, 0x16, 0x32, 0x0b, 0x01};
+       u16 fapi_bool;
+       u8  fapi_u8 = 0;
+       u16 rssi_window = hal_req->config_rssi_window_size ? hal_req->rssi_window_size_val : 8;
+
+       fapi_append_data(req, nan_config_fields_header, sizeof(nan_config_fields_header));
+
+       fapi_append_data(req, &hal_req->master_pref, 1);
+
+       /* publish service ID inclusion in beacon */
+       fapi_bool = hal_req->config_sid_beacon && (hal_req->sid_beacon_val & 0x01);
+       fapi_append_data(req, (u8 *)&fapi_bool, 2);
+       if (fapi_bool)
+               fapi_u8 = hal_req->sid_beacon_val >> 1;
+       fapi_append_data(req, &fapi_u8, 1);
+
+       /* subscribe service ID inclusion in beacon */
+       fapi_bool = hal_req->config_subscribe_sid_beacon && (hal_req->subscribe_sid_beacon_val & 0x01);
+       fapi_append_data(req, (u8 *)&fapi_bool, 2);
+       if (fapi_bool)
+               fapi_u8 = hal_req->subscribe_sid_beacon_val >> 1;
+       fapi_append_data(req, &fapi_u8, 1);
+
+       fapi_append_data(req, (u8 *)&rssi_window, 2);
+       fapi_append_data(req, (u8 *)&hal_req->disc_mac_addr_rand_interval_sec, 4);
+
+       /* 2.4G NAN band specific config*/
+       fapi_u8 = hal_req->config_2dot4g_rssi_close ? hal_req->rssi_close_2dot4g_val : 0;
+       fapi_append_data(req, &fapi_u8, 1);
+       fapi_u8 = hal_req->config_2dot4g_rssi_middle ? hal_req->rssi_middle_2dot4g_val : 0;
+       fapi_append_data(req, &fapi_u8, 1);
+       fapi_u8 = hal_req->config_2dot4g_rssi_proximity ? hal_req->rssi_proximity_2dot4g_val : 0;
+       fapi_append_data(req, &fapi_u8, 1);
+       fapi_append_data(req, &hal_req->scan_params_val.dwell_time[0], 1);
+       fapi_append_data(req, (u8 *)&hal_req->scan_params_val.scan_period[0], 2);
+       fapi_bool = hal_req->config_2dot4g_dw_band;
+       fapi_append_data(req, (u8 *)&fapi_bool, 2);
+       fapi_append_data(req, (u8 *)&hal_req->dw_2dot4g_interval_val, 1);
+
+       /* 5G NAN band specific config*/
+       fapi_u8 = hal_req->config_5g_rssi_close ? hal_req->rssi_close_5g_val : 0;
+       fapi_append_data(req, &fapi_u8, 1);
+       fapi_u8 = hal_req->config_5g_rssi_middle ? hal_req->rssi_middle_5g_val : 0;
+       fapi_append_data(req, &fapi_u8, 1);
+       fapi_u8 = hal_req->config_5g_rssi_close_proximity ? hal_req->rssi_close_proximity_5g_val : 0;
+       fapi_append_data(req, &fapi_u8, 1);
+       fapi_append_data(req, &hal_req->scan_params_val.dwell_time[1], 1);
+       fapi_append_data(req, (u8 *)&hal_req->scan_params_val.scan_period[1], 2);
+       fapi_bool = hal_req->config_5g_dw_band;
+       fapi_append_data(req, (u8 *)&fapi_bool, 2);
+       fapi_append_data(req, (u8 *)&hal_req->dw_5g_interval_val, 1);
 }
 
 int slsi_mlme_nan_enable(struct slsi_dev *sdev, struct net_device *dev, struct slsi_hal_nan_enable_req *hal_req)
@@ -151,26 +107,23 @@ int slsi_mlme_nan_enable(struct slsi_dev *sdev, struct net_device *dev, struct s
        struct sk_buff    *cfm;
        int               r = 0;
        u16               nan_oper_ctrl = 0;
+       u16               operatein5gband = hal_req->config_support_5g && hal_req->support_5g_val;
+       u16               hopcountmax = hal_req->config_hop_count_limit ? hal_req->hop_count_limit_val : 0;
 
        SLSI_NET_DBG3(dev, SLSI_MLME, "\n");
 
-       /* max mbulk data for mlme-nan-start.req is about 87 bytes but
-        * allocate 100 bytes
-        */
-       req = fapi_alloc(mlme_nan_start_req, MLME_NAN_START_REQ, ndev_vif->ifnum, 100);
+       /* max mbulk data IE info length is 0x24. So need 0x26 bytes */
+       req = fapi_alloc(mlme_nan_start_req, MLME_NAN_START_REQ, ndev_vif->ifnum, 0x26);
        if (!req) {
                SLSI_NET_ERR(dev, "fapi alloc failure\n");
                return -ENOMEM;
        }
 
-       /* if (hal_req->config_cluster_attribute_val)
-        * nan_oper_ctrl |= FAPI_NANOPERATIONCONTROL_CLUSTER_SDF;
-        */
        nan_oper_ctrl |= FAPI_NANOPERATIONCONTROL_MAC_ADDRESS_EVENT | FAPI_NANOPERATIONCONTROL_START_CLUSTER_EVENT |
                        FAPI_NANOPERATIONCONTROL_JOINED_CLUSTER_EVENT;
 
-       //fapi_set_u16(req, u.mlme_nan_start_req.cluster_low, hal_req->cluster_low);
-       //fapi_set_u16(req, u.mlme_nan_start_req.cluster_high, hal_req->cluster_high);
+       fapi_set_u16(req, u.mlme_nan_start_req.operatein5gband, operatein5gband);
+       fapi_set_u16(req, u.mlme_nan_start_req.hopcountmax, hopcountmax);
        fapi_set_u16(req, u.mlme_nan_start_req.nan_operation_control_flags, nan_oper_ctrl);
 
        slsi_mlme_nan_enable_fapi_data(req, hal_req);
@@ -228,20 +181,25 @@ static void slsi_mlme_nan_publish_fapi_data(struct sk_buff *req, struct slsi_hal
        u8  nan_publish_fields_header[] = {0xdd, 0x00, 0x00, 0x16, 0x32, 0x0b, 0x02};
        u8 *header_ptr, *end_ptr;
        __le16 le16val;
-       u32 binding_mask = 0;
+       u8  u8val;
 
        header_ptr = fapi_append_data(req, nan_publish_fields_header, sizeof(nan_publish_fields_header));
+       fapi_append_data(req, &hal_req->publish_type, 1);
+       fapi_append_data(req, &hal_req->tx_type, 1);
+
        le16val = cpu_to_le16(hal_req->ttl);
        fapi_append_data(req, (u8 *)&le16val, 2);
        le16val = cpu_to_le16(hal_req->period);
        fapi_append_data(req, (u8 *)&le16val, 2);
-       fapi_append_data(req, &hal_req->publish_type, 1);
-       fapi_append_data(req, &hal_req->tx_type, 1);
        fapi_append_data(req, &hal_req->publish_count, 1);
        fapi_append_data(req, &hal_req->publish_match_indicator, 1);
-       fapi_append_data(req, &hal_req->rssi_threshold_flag, 1);
-       end_ptr = fapi_append_data(req, (u8 *)&binding_mask, 4);
-       end_ptr += 4;
+       le16val = cpu_to_le16(hal_req->rssi_threshold_flag);
+       fapi_append_data(req, (u8 *)&le16val, 2);
+       u8val = 0;
+       fapi_append_data(req, (u8 *)&u8val, 1); /* Ranging required */
+       fapi_append_data(req, (u8 *)&u8val, 1); /* Data path required */
+
+       end_ptr = header_ptr + sizeof(nan_publish_fields_header) + 12;
 
        if (hal_req->service_name_len)
                slsi_mlme_nan_append_tlv(req, cpu_to_le16 (SLSI_FAPI_NAN_SERVICE_NAME),
@@ -254,6 +212,12 @@ static void slsi_mlme_nan_publish_fapi_data(struct sk_buff *req, struct slsi_hal
                                         hal_req->service_specific_info, &header_ptr,
                                         sizeof(nan_publish_fields_header), &end_ptr);
 
+       if (hal_req->sdea_service_specific_info_len)
+               slsi_mlme_nan_append_tlv(req, cpu_to_le16 (SLSI_FAPI_NAN_SDEA),
+                                        cpu_to_le16 (hal_req->sdea_service_specific_info_len),
+                                        hal_req->sdea_service_specific_info,
+                                        &header_ptr, sizeof(nan_publish_fields_header), &end_ptr);
+
        if (hal_req->rx_match_filter_len)
                slsi_mlme_nan_append_tlv(req, cpu_to_le16 (SLSI_FAPI_NAN_RX_MATCH_FILTER),
                                         cpu_to_le16 (hal_req->rx_match_filter_len), hal_req->rx_match_filter,
@@ -279,8 +243,21 @@ int slsi_mlme_nan_publish(struct slsi_dev *sdev, struct net_device *dev, struct
 
        SLSI_NET_DBG3(dev, SLSI_MLME, "\n");
        if (hal_req) {
-               /* max possible length for publish attributes : 8*255 */
-               req = fapi_alloc(mlme_nan_publish_req, MLME_NAN_PUBLISH_REQ, ndev_vif->ifnum, 8 * 255);
+               u16 max_mbulk_data_len;
+               u16 length = 17; /* non tlv info in fapi publish IE */
+
+               length += hal_req->service_name_len ? hal_req->service_name_len + 4 : 0;
+               length += hal_req->service_specific_info_len ? hal_req->service_specific_info_len + 4 : 0;
+               length += hal_req->rx_match_filter_len ? hal_req->rx_match_filter_len + 4 : 0;
+               length += hal_req->tx_match_filter_len ? hal_req->tx_match_filter_len + 4 : 0;
+               length += hal_req->sdea_service_specific_info_len ? hal_req->sdea_service_specific_info_len + 4 : 0;
+               if (length > 255)
+                       /* 2 = ie_id _ie_len, 5 = oui+type+sub_type*/
+                       max_mbulk_data_len = (255 + 2) * (length / (255 - (2 + 5)) + 1);
+               else
+                       max_mbulk_data_len = length + 2;
+
+               req = fapi_alloc(mlme_nan_publish_req, MLME_NAN_PUBLISH_REQ, ndev_vif->ifnum, max_mbulk_data_len);
                if (!req) {
                        SLSI_NET_ERR(dev, "fapi alloc failure\n");
                        return -ENOMEM;
@@ -335,23 +312,26 @@ static void slsi_mlme_nan_subscribe_fapi_data(struct sk_buff *req, struct slsi_h
        u8  nan_subscribe_fields_header[] = {0xdd, 0x00, 0x00, 0x16, 0x32, 0x0b, 0x03};
        u8 *header_ptr, *end_ptr;
        __le16 le16val;
-       u32 binding_mask = 0;
+       u8  u8val = 0;
 
        header_ptr = fapi_append_data(req, nan_subscribe_fields_header, sizeof(nan_subscribe_fields_header));
-       le16val = cpu_to_le16(hal_req->ttl);
-       fapi_append_data(req, (u8 *)&le16val, 2);
-       le16val = cpu_to_le16(hal_req->period);
-       fapi_append_data(req, (u8 *)&le16val, 2);
        fapi_append_data(req, &hal_req->subscribe_type, 1);
        fapi_append_data(req, &hal_req->service_response_filter, 1);
        fapi_append_data(req, &hal_req->service_response_include, 1);
        fapi_append_data(req, &hal_req->use_service_response_filter, 1);
        fapi_append_data(req, &hal_req->ssi_required_for_match_indication, 1);
-       fapi_append_data(req, &hal_req->subscribe_match_indicator, 1);
+
+       le16val = cpu_to_le16(hal_req->ttl);
+       fapi_append_data(req, (u8 *)&le16val, 2);
+       le16val = cpu_to_le16(hal_req->period);
+       fapi_append_data(req, (u8 *)&le16val, 2);
        fapi_append_data(req, &hal_req->subscribe_count, 1);
-       fapi_append_data(req, &hal_req->rssi_threshold_flag, 1);
-       end_ptr = fapi_append_data(req, (u8 *)&binding_mask, 4);
-       end_ptr += 4;
+       fapi_append_data(req, &hal_req->subscribe_match_indicator, 1);
+       le16val = cpu_to_le16(hal_req->rssi_threshold_flag);
+       fapi_append_data(req, (u8 *)&le16val, 2);
+       fapi_append_data(req, &u8val, 1); /* ranging required */
+       end_ptr = fapi_append_data(req, &u8val, 1); /* datapath required */
+       end_ptr += 1;
 
        if (hal_req->service_name_len)
                slsi_mlme_nan_append_tlv(req, cpu_to_le16 (SLSI_FAPI_NAN_SERVICE_NAME),
@@ -374,6 +354,12 @@ static void slsi_mlme_nan_subscribe_fapi_data(struct sk_buff *req, struct slsi_h
                                         cpu_to_le16 (hal_req->tx_match_filter_len), hal_req->tx_match_filter,
                                         &header_ptr, sizeof(nan_subscribe_fields_header), &end_ptr);
 
+       if (hal_req->sdea_service_specific_info_len)
+               slsi_mlme_nan_append_tlv(req, cpu_to_le16 (SLSI_FAPI_NAN_SDEA),
+                                        cpu_to_le16 (hal_req->sdea_service_specific_info_len),
+                                        hal_req->sdea_service_specific_info,
+                                        &header_ptr, sizeof(nan_subscribe_fields_header), &end_ptr);
+
        /* update len */
        header_ptr[1] = end_ptr - header_ptr - 2;
 }
@@ -390,7 +376,21 @@ int slsi_mlme_nan_subscribe(struct slsi_dev *sdev, struct net_device *dev, struc
        SLSI_NET_DBG3(dev, SLSI_MLME, "\n");
        if (hal_req) {
                /*max possible length for publish attributes: 8*255 */
-               req = fapi_alloc(mlme_nan_subscribe_req, MLME_NAN_SUBSCRIBE_REQ, ndev_vif->ifnum, 8 * 255);
+               u16 max_mbulk_data_len;
+               u16 length = 17; /* non tlv info in fapi publish IE */
+
+               length += hal_req->service_name_len ? hal_req->service_name_len + 4 : 0;
+               length += hal_req->service_specific_info_len ? hal_req->service_specific_info_len + 4 : 0;
+               length += hal_req->rx_match_filter_len ? hal_req->rx_match_filter_len + 4 : 0;
+               length += hal_req->tx_match_filter_len ? hal_req->tx_match_filter_len + 4 : 0;
+               length += hal_req->sdea_service_specific_info_len ? hal_req->sdea_service_specific_info_len + 4 : 0;
+               if (length > 255)
+                       /* 2 = ie_id _ie_len, 5 = oui+type+sub_type*/
+                       max_mbulk_data_len = (255 + 2) * (length / (255 - (2 + 5)) + 1);
+               else
+                       max_mbulk_data_len = length + 2;
+
+               req = fapi_alloc(mlme_nan_subscribe_req, MLME_NAN_SUBSCRIBE_REQ, ndev_vif->ifnum, max_mbulk_data_len);
                if (!req) {
                        SLSI_NET_ERR(dev, "fapi alloc failure\n");
                        return -ENOMEM;
@@ -455,6 +455,11 @@ static void slsi_mlme_nan_followup_fapi_data(struct sk_buff *req, struct slsi_ha
                                         cpu_to_le16 (hal_req->service_specific_info_len),
                                         hal_req->service_specific_info, &header_ptr,
                                         sizeof(nan_followup_fields_header), &end_ptr);
+       if (hal_req->sdea_service_specific_info_len)
+               slsi_mlme_nan_append_tlv(req, cpu_to_le16 (SLSI_FAPI_NAN_SDEA),
+                                        cpu_to_le16 (hal_req->sdea_service_specific_info_len),
+                                        hal_req->sdea_service_specific_info, &header_ptr,
+                                        sizeof(nan_followup_fields_header), &end_ptr);
 
        /* update len */
        header_ptr[1] = end_ptr - header_ptr - 2;
@@ -478,16 +483,8 @@ int slsi_mlme_nan_tx_followup(struct slsi_dev *sdev, struct net_device *dev,
                return -ENOMEM;
        }
 
-       /* Set/Enable corresponding bits to disable responses after followUp.
-        * BIT0 - Disable followUp response from FW.
-        */
-       /* if (hal_req->recv_indication_cfg & BIT(0))
-        *  nan_sdf_flags |= FAPI_NANSDFCONTROL_DISABLE_RESPONSES_AFTER_FOLLOWUP;
-        */
-
        fapi_set_u16(req, u.mlme_nan_followup_req.publish_subscribe_id, hal_req->publish_subscribe_id);
        fapi_set_u16(req, u.mlme_nan_followup_req.peer_id, hal_req->requestor_instance_id);
-       /*fapi_set_u16(req, u.mlme_nan_followup_req.requestor_instance_id, hal_req->requestor_instance_id);*/
        fapi_set_u16(req, u.mlme_nan_subscribe_req.nan_sdf_flags, nan_sdf_flags);
 
        slsi_mlme_nan_followup_fapi_data(req, hal_req);
@@ -508,72 +505,55 @@ int slsi_mlme_nan_tx_followup(struct slsi_dev *sdev, struct net_device *dev,
 
 static void slsi_mlme_nan_config_fapi_data(struct sk_buff *req, struct slsi_hal_nan_config_req *hal_req)
 {
-       u8  nan_config_fields_header[] = {0xdd, 0x00, 0x00, 0x16, 0x32, 0x0b, 0x01};
-       u8 *header_ptr;
-       u16 attribute;
-       u8  scan_param[] = {0, 0, 0};
-       int len = 0;
-
-       header_ptr = fapi_append_data(req, nan_config_fields_header, sizeof(nan_config_fields_header));
-       attribute = SLSI_FAPI_NAN_CONFIG_PARAM_MASTER_PREFERENCE;
-       SLSI_FAPI_NAN_ATTRIBUTE_PUT_U16(req, attribute, hal_req->master_pref);
-       len += sizeof(nan_config_fields_header) + 5;
-
-       if (hal_req->config_sid_beacon) {
-               attribute = SLSI_FAPI_NAN_CONFIG_PARAM_SID_BEACON;
-               SLSI_FAPI_NAN_ATTRIBUTE_PUT_U8(req, attribute, hal_req->sid_beacon);
-               len += 5;
-       }
-
-       if (hal_req->config_rssi_proximity) {
-               attribute = SLSI_FAPI_NAN_CONFIG_PARAM_2_4_RSSI_PROXIMITY;
-               SLSI_FAPI_NAN_ATTRIBUTE_PUT_U8(req, attribute, hal_req->rssi_proximity);
-               len += 5;
-       }
-
-       if (hal_req->config_5g_rssi_close_proximity) {
-               attribute = SLSI_FAPI_NAN_CONFIG_PARAM_5_RSSI_PROXIMITY;
-               SLSI_FAPI_NAN_ATTRIBUTE_PUT_U8(req, attribute, hal_req->rssi_close_proximity_5g_val);
-               len += 5;
-       }
-
-       if (hal_req->config_rssi_window_size) {
-               attribute = SLSI_FAPI_NAN_CONFIG_PARAM_RSSI_WINDOW_SIZE;
-               SLSI_FAPI_NAN_ATTRIBUTE_PUT_U8(req, attribute, hal_req->rssi_window_size_val);
-               len += 5;
-       }
-
-       if (hal_req->config_scan_params) {
-               attribute = SLSI_FAPI_NAN_CONFIG_PARAM_SCAN_PARAMETER_2_4;
-               scan_param[0] = hal_req->scan_params_val.dwell_time[0];
-               scan_param[1] = hal_req->scan_params_val.scan_period[0] & 0x00FF;
-               scan_param[2] = (hal_req->scan_params_val.scan_period[0] & 0xFF00) >> 8;
-               SLSI_FAPI_NAN_ATTRIBUTE_PUT_DATA(req, attribute, scan_param, 3);
-               attribute = SLSI_FAPI_NAN_CONFIG_PARAM_SCAN_PARAMETER_5;
-               scan_param[0] = hal_req->scan_params_val.dwell_time[1];
-               scan_param[1] = hal_req->scan_params_val.scan_period[1] & 0x00FF;
-               scan_param[2] = (hal_req->scan_params_val.scan_period[1] & 0xFF00) >> 8;
-               SLSI_FAPI_NAN_ATTRIBUTE_PUT_DATA(req, attribute, scan_param, 3);
-               len += 7 * 2;
-       }
-
-       if (hal_req->config_conn_capability) {
-               u8 con_cap = 0;
-
-               if (hal_req->conn_capability_val.is_wfd_supported)
-                       con_cap |= BIT(0);
-               if (hal_req->conn_capability_val.is_wfds_supported)
-                       con_cap |= BIT(1);
-               if (hal_req->conn_capability_val.is_tdls_supported)
-                       con_cap |= BIT(2);
-               if (hal_req->conn_capability_val.wlan_infra_field)
-                       con_cap |= BIT(3);
-               attribute = SLSI_FAPI_NAN_CONFIG_PARAM_CONNECTION_CAPAB;
-               SLSI_FAPI_NAN_ATTRIBUTE_PUT_U8(req, attribute, hal_req->rssi_window_size_val);
-               len += 5;
-       }
-       /* update len */
-       header_ptr[1] = len - 2;
+       u8  nan_config_fields_header[] = {0xdd, 0x24, 0x00, 0x16, 0x32, 0x0b, 0x01};
+       u16 fapi_bool;
+       u8  fapi_u8 = 0;
+       u16 rssi_window = hal_req->config_rssi_window_size ? hal_req->rssi_window_size_val : 8;
+
+       fapi_append_data(req, nan_config_fields_header, sizeof(nan_config_fields_header));
+
+       fapi_append_data(req, &hal_req->master_pref, 1);
+
+       /* publish service ID inclusion in beacon */
+       fapi_bool = hal_req->config_sid_beacon && (hal_req->sid_beacon & 0x01);
+       fapi_append_data(req, (u8 *)&fapi_bool, 2);
+
+       fapi_u8 = fapi_bool ? hal_req->sid_beacon >> 1 : 0;
+       fapi_append_data(req, &fapi_u8, 1);
+
+       /* subscribe service ID inclusion in beacon */
+       fapi_bool = hal_req->config_subscribe_sid_beacon && (hal_req->subscribe_sid_beacon_val & 0x01);
+       fapi_append_data(req, (u8 *)&fapi_bool, 2);
+
+       fapi_u8 = fapi_bool ? hal_req->subscribe_sid_beacon_val >> 1 : 0;
+       fapi_append_data(req, &fapi_u8, 1);
+
+       fapi_append_data(req, (u8 *)&rssi_window, 2);
+       fapi_append_data(req, (u8 *)&hal_req->disc_mac_addr_rand_interval_sec, 4);
+
+       /* 2.4G NAN band specific config*/
+       fapi_u8 = 0;
+       fapi_append_data(req, &fapi_u8, 1);
+       fapi_append_data(req, &fapi_u8, 1);
+       fapi_u8 = hal_req->config_rssi_proximity ? hal_req->rssi_proximity : 0;
+       fapi_append_data(req, &fapi_u8, 1);
+       fapi_append_data(req, &hal_req->scan_params_val.dwell_time[0], 1);
+       fapi_append_data(req, (u8 *)&hal_req->scan_params_val.scan_period[0], 2);
+       fapi_bool = hal_req->config_2dot4g_dw_band;
+       fapi_append_data(req, (u8 *)&fapi_bool, 2);
+       fapi_append_data(req, (u8 *)&hal_req->dw_2dot4g_interval_val, 1);
+
+       /* 5G NAN band specific config*/
+       fapi_u8 = 0;
+       fapi_append_data(req, &fapi_u8, 1);
+       fapi_append_data(req, &fapi_u8, 1);
+       fapi_u8 = hal_req->config_5g_rssi_close_proximity ? hal_req->rssi_close_proximity_5g_val : 0;
+       fapi_append_data(req, &fapi_u8, 1);
+       fapi_append_data(req, &hal_req->scan_params_val.dwell_time[1], 1);
+       fapi_append_data(req, (u8 *)&hal_req->scan_params_val.scan_period[1], 2);
+       fapi_bool = hal_req->config_5g_dw_band;
+       fapi_append_data(req, (u8 *)&fapi_bool, 2);
+       fapi_append_data(req, (u8 *)&hal_req->dw_5g_interval_val, 1);
 }
 
 int slsi_mlme_nan_set_config(struct slsi_dev *sdev, struct net_device *dev, struct slsi_hal_nan_config_req *hal_req)
@@ -592,9 +572,6 @@ int slsi_mlme_nan_set_config(struct slsi_dev *sdev, struct net_device *dev, stru
                return -ENOMEM;
        }
 
-       /* if (hal_req->config_cluster_attribute_val)
-        *  nan_oper_ctrl |= FAPI_NANOPERATIONCONTROL_CLUSTER_SDF;
-        */
        nan_oper_ctrl |= FAPI_NANOPERATIONCONTROL_MAC_ADDRESS_EVENT | FAPI_NANOPERATIONCONTROL_START_CLUSTER_EVENT |
                        FAPI_NANOPERATIONCONTROL_JOINED_CLUSTER_EVENT;
        fapi_set_u16(req, u.mlme_nan_config_req.nan_operation_control_flags, nan_oper_ctrl);
index f005162e74f7328b9676d7c58c9fdfa0b557e6f0..f01f5a463c7f6b9381c3824df90054f7d10cd953 100755 (executable)
@@ -275,6 +275,29 @@ static int slsi_nan_enable_get_nl_params(struct slsi_dev *sdev, struct slsi_hal_
                        hal_req->config_5g_channel = 1;
                        break;
 
+               case NAN_REQ_ATTR_SUBSCRIBE_SID_BEACON_VAL:
+                       hal_req->subscribe_sid_beacon_val = nla_get_u8(iter);
+                       hal_req->config_subscribe_sid_beacon = 1;
+                       break;
+
+               case NAN_REQ_ATTR_DW_2G4_INTERVAL:
+                       hal_req->dw_2dot4g_interval_val = nla_get_u8(iter);
+                       /* valid range for 2.4G is 1-5 */
+                       if (hal_req->dw_2dot4g_interval_val > 0  && hal_req->dw_2dot4g_interval_val < 5)
+                               hal_req->config_2dot4g_dw_band = 1;
+                       break;
+
+               case NAN_REQ_ATTR_DW_5G_INTERVAL:
+                       hal_req->dw_5g_interval_val = nla_get_u8(iter);
+                       /* valid range for 5g is 0-5 */
+                       if (hal_req->dw_5g_interval_val < 5)
+                               hal_req->config_5g_dw_band = 1;
+                       break;
+
+               case NAN_REQ_ATTR_DISC_MAC_ADDR_RANDOM_INTERVAL:
+                       hal_req->disc_mac_addr_rand_interval_sec = nla_get_u8(iter);
+                       break;
+
                default:
                        SLSI_ERR(sdev, "Unexpected NAN enable attribute TYPE:%d\n", type);
                        return SLSI_HAL_NAN_STATUS_INVALID_PARAM;
@@ -462,6 +485,15 @@ static int slsi_nan_publish_get_nl_params(struct slsi_dev *sdev, struct slsi_hal
                        hal_req->recv_indication_cfg = nla_get_u8(iter);
                        break;
 
+               case NAN_REQ_ATTR_PUBLISH_SDEA_LEN:
+                       hal_req->sdea_service_specific_info_len = nla_get_u16(iter);
+                       break;
+
+               case NAN_REQ_ATTR_PUBLISH_SDEA:
+                       memcpy(hal_req->sdea_service_specific_info, nla_data(iter),
+                              hal_req->sdea_service_specific_info_len);
+                       break;
+
                default:
                        SLSI_ERR(sdev, "Unexpected NAN publish attribute TYPE:%d\n", type);
                        return SLSI_HAL_NAN_STATUS_INVALID_PARAM;
@@ -686,6 +718,15 @@ static int slsi_nan_subscribe_get_nl_params(struct slsi_dev *sdev, struct slsi_h
                        hal_req->recv_indication_cfg = nla_get_u8(iter);
                        break;
 
+               case NAN_REQ_ATTR_PUBLISH_SDEA_LEN:
+                       hal_req->sdea_service_specific_info_len = nla_get_u16(iter);
+                       break;
+
+               case NAN_REQ_ATTR_PUBLISH_SDEA:
+                       memcpy(hal_req->sdea_service_specific_info, nla_data(iter),
+                              hal_req->sdea_service_specific_info_len);
+                       break;
+
                default:
                        SLSI_ERR(sdev, "Unexpected NAN subscribe attribute TYPE:%d\n", type);
                        return SLSI_HAL_NAN_STATUS_INVALID_PARAM;
@@ -855,6 +896,15 @@ static int slsi_nan_followup_get_nl_params(struct slsi_dev *sdev, struct slsi_ha
                        hal_req->recv_indication_cfg = nla_get_u8(iter);
                        break;
 
+               case NAN_REQ_ATTR_PUBLISH_SDEA_LEN:
+                       hal_req->sdea_service_specific_info_len =  nla_get_u16(iter);
+                       break;
+
+               case NAN_REQ_ATTR_PUBLISH_SDEA:
+                       memcpy(hal_req->sdea_service_specific_info, nla_data(iter),
+                              hal_req->sdea_service_specific_info_len);
+                       break;
+
                default:
                        SLSI_ERR(sdev, "Unexpected NAN followup attribute TYPE:%d\n", type);
                        return SLSI_HAL_NAN_STATUS_INVALID_PARAM;
@@ -1113,6 +1163,30 @@ static int slsi_nan_config_get_nl_params(struct slsi_dev *sdev, struct slsi_hal_
                                }
                        }
                        break;
+
+               case NAN_REQ_ATTR_SUBSCRIBE_SID_BEACON_VAL:
+                       hal_req->subscribe_sid_beacon_val = nla_get_u8(iter);
+                       hal_req->config_subscribe_sid_beacon = 1;
+                       break;
+
+               case NAN_REQ_ATTR_DW_2G4_INTERVAL:
+                       hal_req->dw_2dot4g_interval_val = nla_get_u8(iter);
+                       /* valid range for 2.4G is 1-5 */
+                       if (hal_req->dw_2dot4g_interval_val > 0  && hal_req->dw_2dot4g_interval_val < 6)
+                               hal_req->config_2dot4g_dw_band = 1;
+                       break;
+
+               case NAN_REQ_ATTR_DW_5G_INTERVAL:
+                       hal_req->dw_5g_interval_val = nla_get_u8(iter);
+                       /* valid range for 5g is 0-5 */
+                       if (hal_req->dw_5g_interval_val < 6)
+                               hal_req->config_5g_dw_band = 1;
+                       break;
+
+               case NAN_REQ_ATTR_DISC_MAC_ADDR_RANDOM_INTERVAL:
+                       hal_req->disc_mac_addr_rand_interval_sec = nla_get_u8(iter);
+                       break;
+
                default:
                        SLSI_ERR(sdev, "Unexpected NAN config attribute TYPE:%d\n", type);
                        return SLSI_HAL_NAN_STATUS_INVALID_PARAM;
@@ -1389,6 +1463,9 @@ void slsi_nan_followup_ind(struct slsi_dev *sdev, struct net_device *dev, struct
                if (tag_id == SLSI_FAPI_NAN_SERVICE_SPECIFIC_INFO) {
                        hal_evt->service_specific_info_len = tag_len;
                        memcpy(hal_evt->service_specific_info, ptr, tag_len);
+               } else if (tag_id == SLSI_FAPI_NAN_SDEA) {
+                       hal_evt->sdea_service_specific_info_len = tag_len;
+                       memcpy(hal_evt->sdea_service_specific_info, ptr, tag_len);
                }
                ptr += tag_len;
        }
@@ -1422,6 +1499,10 @@ void slsi_nan_followup_ind(struct slsi_dev *sdev, struct net_device *dev, struct
        if (hal_evt->service_specific_info_len)
                res |= nla_put(nl_skb, NAN_EVT_ATTR_FOLLOWUP_SERVICE_SPECIFIC_INFO, hal_evt->service_specific_info_len,
                               hal_evt->service_specific_info);
+       res |= nla_put_u16(nl_skb, NAN_EVT_ATTR_SDEA_LEN, hal_evt->sdea_service_specific_info_len);
+       if (hal_evt->sdea_service_specific_info_len)
+               res |= nla_put(nl_skb, NAN_EVT_ATTR_SDEA, hal_evt->sdea_service_specific_info_len,
+                              hal_evt->sdea_service_specific_info);
 
        if (res) {
                SLSI_ERR(sdev, "Error in nla_put*:%x\n", res);
@@ -1444,10 +1525,7 @@ void slsi_nan_service_ind(struct slsi_dev *sdev, struct net_device *dev, struct
        int stitched_ie_len;
        struct slsi_hal_nan_match_ind *hal_evt;
        struct sk_buff *nl_skb;
-       int res, i;
-       struct slsi_hal_nan_receive_post_discovery *discovery_attr;
-       struct slsi_hal_nan_further_availability_channel *famchan;
-       struct nlattr *nlattr_nested;
+       int res;
 
        SLSI_DBG3(sdev, SLSI_GSCAN, "\n");
 
@@ -1479,7 +1557,7 @@ void slsi_nan_service_ind(struct slsi_dev *sdev, struct net_device *dev, struct
                return;
        }
        hal_evt->publish_subscribe_id = fapi_get_u16(skb, u.mlme_nan_service_ind.publish_subscribe_id);
-       hal_evt->requestor_instance_id = fapi_get_u32(skb, u.mlme_nan_service_ind.peer_id);
+       hal_evt->requestor_instance_id = fapi_get_u16(skb, u.mlme_nan_service_ind.peer_id);
 
        /* 7 = ie_id(1), ie_len(1), oui(3) type/subtype(2)*/
        ptr = stitched_ie_p + 7;
@@ -1490,7 +1568,7 @@ void slsi_nan_service_ind(struct slsi_dev *sdev, struct net_device *dev, struct
        hal_evt->out_of_resource_flag = *ptr;
        ptr += 1;
        hal_evt->rssi_value = *ptr;
-       ptr += 1;
+       ptr += 1 + 8; /* skip 8 bytes related to datapath and ranging*/
        while (stitched_ie_len > (ptr - stitched_ie_p) + 4) {
                tag_id = *(u16 *)ptr;
                ptr += 2;
@@ -1507,40 +1585,15 @@ void slsi_nan_service_ind(struct slsi_dev *sdev, struct net_device *dev, struct
                        hal_evt->service_specific_info_len = tag_len;
                        memcpy(hal_evt->service_specific_info, ptr, tag_len);
                        break;
-               case SLSI_FAPI_NAN_CONFIG_PARAM_CONNECTION_CAPAB:
-                       hal_evt->is_conn_capability_valid = 1;
-                       if (*ptr & BIT(0))
-                               hal_evt->conn_capability.is_wfd_supported = 1;
-                       if (*ptr & BIT(1))
-                               hal_evt->conn_capability.is_wfds_supported = 1;
-                       if (*ptr & BIT(2))
-                               hal_evt->conn_capability.is_tdls_supported = 1;
-                       if (*ptr & BIT(3))
-                               hal_evt->conn_capability.wlan_infra_field = 1;
-                       break;
-               case SLSI_FAPI_NAN_CONFIG_PARAM_POST_DISCOVER_PARAM:
-                       discovery_attr = &hal_evt->discovery_attr[hal_evt->num_rx_discovery_attr];
-                       discovery_attr->type = ptr[0];
-                       discovery_attr->role = ptr[1];
-                       discovery_attr->duration = ptr[2];
-                       discovery_attr->avail_interval_bitmap = le32_to_cpu(*(__le32 *)&ptr[3]);
-                       ether_addr_copy(discovery_attr->addr, &ptr[7]);
-                       discovery_attr->infrastructure_ssid_len = ptr[13];
-                       if (discovery_attr->infrastructure_ssid_len)
-                               memcpy(discovery_attr->infrastructure_ssid_val, &ptr[14],
-                                      discovery_attr->infrastructure_ssid_len);
-                       hal_evt->num_rx_discovery_attr++;
-                       break;
-               case SLSI_FAPI_NAN_CONFIG_PARAM_FURTHER_AVAIL_CHANNEL_MAP:
-                       famchan = &hal_evt->famchan[hal_evt->num_chans];
-                       famchan->entry_control = ptr[0];
-                       famchan->class_val =  ptr[1];
-                       famchan->channel = ptr[2];
-                       famchan->mapid = ptr[3];
-                       famchan->avail_interval_bitmap = le32_to_cpu(*(__le32 *)&ptr[4]);
-                       hal_evt->num_chans++;
-                       break;
-               case SLSI_FAPI_NAN_CLUSTER_ATTRIBUTE:
+
+               case SLSI_FAPI_NAN_SDEA:
+                       hal_evt->sdea_service_specific_info_len = tag_len;
+                       memcpy(hal_evt->sdea_service_specific_info, ptr, tag_len);
+                       break;
+
+               case SLSI_FAPI_NAN_SDF_MATCH_FILTER:
+                       hal_evt->sdf_match_filter_len = tag_len;
+                       memcpy(hal_evt->sdf_match_filter, ptr, tag_len);
                        break;
                }
                ptr += tag_len;
@@ -1573,82 +1626,14 @@ void slsi_nan_service_ind(struct slsi_dev *sdev, struct net_device *dev, struct
        if (hal_evt->sdf_match_filter_len)
                res |= nla_put(nl_skb, NAN_EVT_ATTR_MATCH_SDF_MATCH_FILTER, hal_evt->sdf_match_filter_len,
                        hal_evt->sdf_match_filter);
+       res |= nla_put_u16(nl_skb, NAN_EVT_ATTR_SDEA_LEN, hal_evt->sdea_service_specific_info_len);
+       if (hal_evt->sdea_service_specific_info_len)
+               res |= nla_put(nl_skb, NAN_EVT_ATTR_SDEA, hal_evt->sdea_service_specific_info_len,
+                       hal_evt->sdea_service_specific_info);
 
        res |= nla_put_u8(nl_skb, NAN_EVT_ATTR_MATCH_MATCH_OCCURRED_FLAG, hal_evt->match_occurred_flag);
        res |= nla_put_u8(nl_skb, NAN_EVT_ATTR_MATCH_OUT_OF_RESOURCE_FLAG, hal_evt->out_of_resource_flag);
        res |= nla_put_u8(nl_skb, NAN_EVT_ATTR_MATCH_RSSI_VALUE, hal_evt->rssi_value);
-       res |= nla_put_u8(nl_skb, NAN_EVT_ATTR_MATCH_CONN_CAPABILITY_IS_IBSS_SUPPORTED,
-               hal_evt->is_conn_capability_valid);
-       if (hal_evt->is_conn_capability_valid) {
-               res |= nla_put_u8(nl_skb, NAN_EVT_ATTR_MATCH_CONN_CAPABILITY_IS_IBSS_SUPPORTED,
-                       hal_evt->conn_capability.is_ibss_supported);
-               res |= nla_put_u8(nl_skb, NAN_EVT_ATTR_MATCH_CONN_CAPABILITY_IS_WFD_SUPPORTED,
-                       hal_evt->conn_capability.is_wfd_supported);
-               res |= nla_put_u8(nl_skb, NAN_EVT_ATTR_MATCH_CONN_CAPABILITY_IS_WFDS_SUPPORTED,
-                       hal_evt->conn_capability.is_wfds_supported);
-               res |= nla_put_u8(nl_skb, NAN_EVT_ATTR_MATCH_CONN_CAPABILITY_IS_TDLS_SUPPORTED,
-                       hal_evt->conn_capability.is_tdls_supported);
-               res |= nla_put_u8(nl_skb, NAN_EVT_ATTR_MATCH_CONN_CAPABILITY_IS_MESH_SUPPORTED,
-                       hal_evt->conn_capability.is_mesh_supported);
-               res |= nla_put_u8(nl_skb, NAN_EVT_ATTR_MATCH_CONN_CAPABILITY_WLAN_INFRA_FIELD,
-                       hal_evt->conn_capability.wlan_infra_field);
-       }
-
-       res |= nla_put_u8(nl_skb, NAN_EVT_ATTR_MATCH_NUM_RX_DISCOVERY_ATTR, hal_evt->num_rx_discovery_attr);
-       for (i = 0; i < hal_evt->num_rx_discovery_attr; i++) {
-               nlattr_nested = nla_nest_start(nl_skb, NAN_EVT_ATTR_MATCH_RX_DISCOVERY_ATTR);
-               if (!nlattr_nested) {
-                       SLSI_ERR(sdev, "Error in nla_nest_start\n");
-                       /* Dont use slsi skb wrapper for this free */
-                       kfree_skb(nl_skb);
-                       kfree(hal_evt);
-                       kfree(stitched_ie_p);
-                       return;
-               }
-               discovery_attr = &hal_evt->discovery_attr[i];
-               res |= nla_put_u8(nl_skb, NAN_EVT_ATTR_MATCH_DISC_ATTR_TYPE, discovery_attr->type);
-               res |= nla_put_u8(nl_skb, NAN_EVT_ATTR_MATCH_DISC_ATTR_ROLE, discovery_attr->role);
-               res |= nla_put_u8(nl_skb, NAN_EVT_ATTR_MATCH_DISC_ATTR_DURATION, discovery_attr->duration);
-               res |= nla_put_u32(nl_skb, NAN_EVT_ATTR_MATCH_DISC_ATTR_AVAIL_INTERVAL_BITMAP,
-                      discovery_attr->avail_interval_bitmap);
-               res |= nla_put_u8(nl_skb, NAN_EVT_ATTR_MATCH_DISC_ATTR_MAPID, discovery_attr->mapid);
-               res |= nla_put(nl_skb, NAN_EVT_ATTR_MATCH_DISC_ATTR_ADDR, ETH_ALEN, discovery_attr->addr);
-               res |= nla_put_u8(nl_skb, NAN_EVT_ATTR_MATCH_DISC_ATTR_MESH_ID_LEN, discovery_attr->mesh_id_len);
-               if (discovery_attr->mesh_id_len)
-                       res |= nla_put(nl_skb, NAN_EVT_ATTR_MATCH_DISC_ATTR_MESH_ID, discovery_attr->mesh_id_len,
-                              discovery_attr->mesh_id);
-               res |= nla_put_u8(nl_skb, NAN_EVT_ATTR_MATCH_DISC_ATTR_INFRASTRUCTURE_SSID_LEN,
-                      discovery_attr->infrastructure_ssid_len);
-               if (discovery_attr->infrastructure_ssid_len)
-                       res |= nla_put(nl_skb, NAN_EVT_ATTR_MATCH_DISC_ATTR_INFRASTRUCTURE_SSID_VAL,
-                              discovery_attr->infrastructure_ssid_len, discovery_attr->infrastructure_ssid_val);
-               nla_nest_end(nl_skb, nlattr_nested);
-       }
-
-       res |= nla_put_u8(nl_skb, NAN_EVT_ATTR_MATCH_NUM_CHANS, hal_evt->num_chans);
-       for (i = 0; i < hal_evt->num_chans; i++) {
-               nlattr_nested = nla_nest_start(nl_skb, NAN_EVT_ATTR_MATCH_FAMCHAN);
-               if (!nlattr_nested) {
-                       SLSI_ERR(sdev, "Error in nla_nest_start\n");
-                       /* Dont use slsi skb wrapper for this free */
-                       kfree_skb(nl_skb);
-                       kfree(hal_evt);
-                       kfree(stitched_ie_p);
-                       return;
-               }
-               famchan = &hal_evt->famchan[i];
-               res |= nla_put_u8(nl_skb, NAN_EVT_ATTR_MATCH_FAM_ENTRY_CONTROL, famchan->entry_control);
-               res |= nla_put_u8(nl_skb, NAN_EVT_ATTR_MATCH_FAM_CLASS_VAL, famchan->class_val);
-               res |= nla_put_u8(nl_skb, NAN_EVT_ATTR_MATCH_FAM_CHANNEL, famchan->channel);
-               res |= nla_put_u8(nl_skb, NAN_EVT_ATTR_MATCH_FAM_MAPID, famchan->mapid);
-               res |= nla_put_u32(nl_skb, NAN_EVT_ATTR_MATCH_FAM_AVAIL_INTERVAL_BITMAP,
-                                  famchan->avail_interval_bitmap);
-       }
-
-       res |= nla_put_u8(nl_skb, NAN_EVT_ATTR_MATCH_CLUSTER_ATTRIBUTE_LEN, hal_evt->cluster_attribute_len);
-       if (hal_evt->cluster_attribute_len)
-               res |= nla_put(nl_skb, NAN_EVT_ATTR_MATCH_CLUSTER_ATTRIBUTE, hal_evt->cluster_attribute_len,
-                              hal_evt->cluster_attribute);
 
        if (res) {
                SLSI_ERR(sdev, "Error in nla_put*:%x\n", res);
index c6ceed1122b3f62252e61ccc4a16feff4136c43f..5d48b327d9de30e2ae98b426f8bc0de23c223a5e 100755 (executable)
@@ -128,7 +128,13 @@ enum SLSI_NAN_REQ_ATTRIBUTES {
        NAN_REQ_ATTR_FOLLOWUP_SERVICE_NAME_LEN,
        NAN_REQ_ATTR_FOLLOWUP_SERVICE_NAME,
        NAN_REQ_ATTR_FOLLOWUP_TX_WINDOW,
-       NAN_REQ_ATTR_FOLLOWUP_RECV_IND_CFG
+       NAN_REQ_ATTR_FOLLOWUP_RECV_IND_CFG,
+       NAN_REQ_ATTR_SUBSCRIBE_SID_BEACON_VAL,
+       NAN_REQ_ATTR_DW_2G4_INTERVAL,
+       NAN_REQ_ATTR_DW_5G_INTERVAL,
+       NAN_REQ_ATTR_DISC_MAC_ADDR_RANDOM_INTERVAL,
+       NAN_REQ_ATTR_PUBLISH_SDEA_LEN,
+       NAN_REQ_ATTR_PUBLISH_SDEA
 };
 
 enum SLSI_NAN_RESP_ATTRIBUTES {
@@ -202,7 +208,10 @@ enum SLSI_NAN_EVT_ATTRIBUTES {
        NAN_EVT_ATTR_FOLLOWUP_SERVICE_SPECIFIC_INFO,
        NAN_EVT_ATTR_DISCOVERY_ENGINE_EVT_TYPE,
        NAN_EVT_ATTR_DISCOVERY_ENGINE_MAC_ADDR,
-       NAN_EVT_ATTR_DISCOVERY_ENGINE_CLUSTER
+       NAN_EVT_ATTR_DISCOVERY_ENGINE_CLUSTER,
+
+       NAN_EVT_ATTR_SDEA,
+       NAN_EVT_ATTR_SDEA_LEN
 };
 
 #define SLSI_FAPI_NAN_CONFIG_PARAM_SID_BEACON 0X0003
@@ -228,6 +237,8 @@ enum SLSI_NAN_EVT_ATTRIBUTES {
 #define SLSI_FAPI_NAN_TX_MATCH_FILTER 0X0023
 #define SLSI_FAPI_NAN_SDF_MATCH_FILTER 0X0024
 #define SLSI_FAPI_NAN_CLUSTER_ATTRIBUTE 0X0025
+#define SLSI_FAPI_NAN_INTERFACE_ADDRESS_SET 0X0026
+#define SLSI_FAPI_NAN_SDEA 0X0027
 
 #define SLSI_HAL_NAN_MAX_SOCIAL_CHANNELS 3
 #define SLSI_HAL_NAN_MAX_SERVICE_NAME_LEN 255
@@ -235,6 +246,7 @@ enum SLSI_NAN_EVT_ATTRIBUTES {
 #define SLSI_HAL_NAN_MAX_MATCH_FILTER_LEN 255
 #define SLSI_HAL_NAN_MAX_SUBSCRIBE_MAX_ADDRESS 42
 #define SLSI_HAL_NAN_MAX_POSTDISCOVERY_LEN 5
+#define SLSI_HAL_NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN 1024
 
 enum slsi_wifi_hal_nan_status_type {
        /* NAN Protocol Response Codes */
@@ -471,6 +483,15 @@ struct slsi_hal_nan_enable_req {
 
        u8 config_5g_channel;
        int channel_5g_val;
+       u8 config_subscribe_sid_beacon;
+       u32 subscribe_sid_beacon_val;
+
+       /*NanConfigDW config_dw*/
+       u8 config_2dot4g_dw_band;
+       u32 dw_2dot4g_interval_val;
+       u8 config_5g_dw_band;
+       u32 dw_5g_interval_val;
+       u32 disc_mac_addr_rand_interval_sec;
 };
 
 struct slsi_hal_nan_publish_req {
@@ -520,6 +541,9 @@ struct slsi_hal_nan_publish_req {
         * BIT2 - Disable followUp indication received (OTA).
         */
        u8 recv_indication_cfg;
+
+       u16 sdea_service_specific_info_len;
+       u8 sdea_service_specific_info[SLSI_HAL_NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN];
 };
 
 struct slsi_hal_nan_subscribe_req {
@@ -610,6 +634,9 @@ struct slsi_hal_nan_subscribe_req {
         * BIT2 - Disable followUp indication received (OTA).
         */
        u8 recv_indication_cfg;
+
+       u16 sdea_service_specific_info_len;
+       u8 sdea_service_specific_info[SLSI_HAL_NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN];
 };
 
 struct slsi_hal_nan_transmit_followup_req {
@@ -634,6 +661,9 @@ struct slsi_hal_nan_transmit_followup_req {
         * BIT0 - Disable followUp response from FW.
         */
        u8 recv_indication_cfg;
+
+       u16 sdea_service_specific_info_len;
+       u8 sdea_service_specific_info[SLSI_HAL_NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN];
 };
 
 struct slsi_hal_nan_config_req {
@@ -680,6 +710,18 @@ struct slsi_hal_nan_config_req {
        /* NAN Further availability Map */
        u8 config_fam;
        struct slsi_hal_nan_further_availability_map fam_val;
+
+       int channel_5g_val;
+       u8 config_subscribe_sid_beacon;
+       u32 subscribe_sid_beacon_val;
+
+       /*NanConfigDW config_dw*/
+       u8 config_2dot4g_dw_band;
+       u32 dw_2dot4g_interval_val;
+       u8 config_5g_dw_band;
+       u32 dw_5g_interval_val;
+       u32 disc_mac_addr_rand_interval_sec;
+
 };
 
 struct slsi_hal_nan_capabilities {
@@ -704,6 +746,8 @@ struct slsi_hal_nan_followup_ind {
        u8 dw_or_faw;
        u16 service_specific_info_len;
        u8 service_specific_info[SLSI_HAL_NAN_MAX_SERVICE_SPECIFIC_INFO_LEN];
+       u16 sdea_service_specific_info_len;
+       u8 sdea_service_specific_info[SLSI_HAL_NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN];
 };
 
 struct slsi_hal_nan_match_ind {
@@ -725,6 +769,8 @@ struct slsi_hal_nan_match_ind {
        struct slsi_hal_nan_further_availability_channel famchan[32];
        u8 cluster_attribute_len;
        u8 cluster_attribute[32];
+       u16 sdea_service_specific_info_len;
+       u8 sdea_service_specific_info[SLSI_HAL_NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN];
 };
 
 void slsi_nan_event(struct slsi_dev *sdev, struct net_device *dev, struct sk_buff *skb);