Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Highlevel Block diagram

  • Prerequisites

    • Enable the distro 
      • draw.io Diagram
        bordertrue
        diagramNamedispi
        simpleViewerfalse
        width
        linksauto
        tbstyletop
        lboxtrue
        diagramWidth821
        height301
        revision1
      • Hal definitions
      • PSM configurations

        • As part of device you may need to have passpoint and interworking specific psm entries in the psm config file and by default the code for RFC params for passpoint and interworking are under feature flags.when we enable the distro code is compiled in CcspPandM
        • draw.io Diagram
          bordertrue
          diagramNamepppsm
          simpleViewerfalse
          width
          linksauto
          tbstyletop
          lboxtrue
          diagramWidth911
          height231
          revision1
        • draw.io Diagram
          bordertrue
          diagramNamedmlsrfc
          simpleViewerfalse
          width
          linksauto
          tbstyletop
          lboxtrue
          diagramWidth921
          height491
          revision1
      • CcspwifiAgent side - No code changes required

      • Reference for operators(Just for understanding)

        • draw.io Diagram
          bordertrue
          diagramNameprototype
          simpleViewerfalse
          width
          linksauto
          tbstyletop
          lboxtrue
          diagramWidth981
          height351
          revision2
        • Code Block
          /* GAS Configuration */
          #define GAS_CFG_TYPE_SUPPORTED 1
          
          /* GAS Configuration */
          typedef struct _wifi_GASConfiguration_t{   // Values correspond to the dot11GASAdvertisementEntry field definitions; see 802.11-2016 Annex C.3.
              unsigned int AdvertisementID;
              bool PauseForServerResponse;
              unsigned int ResponseTimeout;
              unsigned int ComeBackDelay;
              unsigned int ResponseBufferingTime;
              unsigned int QueryResponseLengthLimit;
          }__attribute__((packed))wifi_GASConfiguration_t;
          
          typedef enum {
              wifi_anqp_element_name_reserved_0,
              wifi_anqp_element_name_query_list = 256,
              wifi_anqp_element_name_capability_list,
              wifi_anqp_element_name_venue_name,
              wifi_anqp_element_name_emergency_call_number,
              wifi_anqp_element_name_network_auth_type,
              wifi_anqp_element_name_roaming_consortium,
              wifi_anqp_element_name_ip_address_availabality,
              wifi_anqp_element_name_nai_realm,
              wifi_anqp_element_name_3gpp_cellular_network,
              wifi_anqp_element_name_geo_location,
              wifi_anqp_element_name_civic_location,
              wifi_anqp_element_name_loc_public_id,
              wifi_anqp_element_name_domain_name,
              wifi_anqp_element_name_emergency_alert_id,
              wifi_anqp_element_name_tdls_capability,
              wifi_anqp_element_name_emergency_nai,
              wifi_anqp_element_name_neighbor_report,
              wifi_anqp_element_name_venue_url,
              wifi_anqp_element_name_advice_of_charge,
              wifi_anqp_element_name_local_content,
              wifi_anqp_element_name_network_auth_type_with_timestamp,
              wifi_anqp_element_name_reserved_1 = 273,
              wifi_anqp_element_name_vendor_specific = 56797,
              wifi_anqp_element_name_reserved_2
          } wifi_anqp_element_name_t;
          typedef enum {
              wifi_anqp_element_hs_subtype_reserved_0,
              wifi_anqp_element_hs_subtype_hs_query_list,
              wifi_anqp_element_hs_subtype_hs_capability_list,
              wifi_anqp_element_hs_subtype_operator_friendly_name,
              wifi_anqp_element_hs_subtype_wan_metrics,
              wifi_anqp_element_hs_subtype_conn_capability,
              wifi_anqp_element_hs_subtype_nai_home_realm_query,
              wifi_anqp_element_hs_subtype_op_class_ind,
              wifi_anqp_element_hs_subtype_osu_providers_list,
              wifi_anqp_element_hs_subtype_reserved_1,
              wifi_anqp_element_hs_subtype_icon_request,
              wifi_anqp_element_hs_subtype_icon_bin_file,
              wifi_anqp_element_hs_subtype_op_icon_metadata,
              wifi_anqp_element_hs_subtype_op_providers_nai_list,
              wifi_anqp_element_hs_subtype_reserved_2
          } wifi_anqp_element_hs_subtype_t;
          typedef enum {
              wifi_anqp_id_type_anqp,
              wifi_anqp_id_type_hs
          } wifi_anqp_id_type_t;
          typedef struct {
              wifi_anqp_id_type_t     type;
              union {
                  wifi_anqp_element_name_t        anqp_elem_id;
                  wifi_anqp_element_hs_subtype_t  anqp_hs_id;
              } u;
              UINT    len;
              UCHAR   *data;
          } wifi_anqp_elem_t;
          typedef struct wifi_anqp_node {
              struct wifi_anqp_node    *next;
              wifi_anqp_elem_t    *value;
          } wifi_anqp_node_t;
          
          
          typedef struct {
              UCHAR    wifiRoamingConsortiumCount;
              UCHAR    wifiRoamingConsortiumOui[3][15+1];//only 3 OIS is allowed in beacon and probe responses OIS length is variable between 3-15
              UCHAR    wifiRoamingConsortiumLen[3];
          }__attribute__((packed)) wifi_roamingConsortiumElement_t;
          
          
          typedef struct {
             // wifi_InterworkingElement_t   interworking;
              wifi_roamingConsortiumElement_t roamingConsortium;
              //wifi_anqp_settings_t        anqp;                   //should not be implemented in the hal
              //wifi_passpoint_settings_t   passpoint;
          }__attribute__((packed)) wifi_interworking_t;
          
          //----------------------------------------------------------
          int enablePassPointSettings(int ap_index, bool passpoint_enable, bool downstream_disable, bool p2p_disable, bool layer2TIF)
          {
                  printf("enablePassPointSettings.\n");
          #ifdef CKP
              if (ap_index < 0 || ap_index > MAX_AP_INDEX)
              {
                  wifi_anqp_dbg_print(1, "%s:%d:Invalid ap index:   %d\n", __func__, __LINE__, ap_index);
                  return RETURN_ERR;
              }
              if(!hs2SettingsStored)
              {
                  hs2SettingsStored = TRUE;
                  wifi_storeInitialPassPointSettings();
              }
              if (passpoint_enable)
              {
                  wifi_anqp_dbg_print(1, "%s:%d:Enabling HS2 Settings for ap index:   %d\n", __func__, __LINE__, ap_index);
                  wifi_setCountryIe(ap_index, passpoint_enable);
                  wifi_setProxyArp(ap_index, passpoint_enable);
                  wifi_setLayer2TrafficInspectionFiltering(ap_index, layer2TIF);
                  wifi_setDownStreamGroupAddress(ap_index, downstream_disable);
                  wifi_setBssLoad(ap_index, passpoint_enable);
                  wifi_setP2PCrossConnect(ap_index, p2p_disable);
              }
              else
              {
                  //set the values initially stored in hs2settings for ap index.
                  wifi_anqp_dbg_print(1, "%s:%d:Disabling HS2 Settings for ap index:   %d\n", __func__, __LINE__, ap_index);
                  wifi_setCountryIe(ap_index, hs2Settings[ap_index].countryIe);
                  wifi_setProxyArp(ap_index, hs2Settings[ap_index].proxyArp);
                  wifi_setLayer2TrafficInspectionFiltering(ap_index, hs2Settings[ap_index].layer2TIF);
                  wifi_setDownStreamGroupAddress(ap_index, hs2Settings[ap_index].downStreamGroupAddress);
                  wifi_setBssLoad(ap_index, hs2Settings[ap_index].bssLoad);
              }
              if(wifi_pushApHotspotElement(ap_index,passpoint_enable)!= RETURN_OK)
              {
                  return RETURN_ERR;
              }
          #endif
                  return 1;
          }
          
          int wifi_setGASConfiguration(unsigned int advertisementID, wifi_GASConfiguration_t *input_struct)
          {
                  printf("wifi_setGASConfiguration.\n");
                  return 1;
          }
          
          // Dummy function to simulate callback registration
          int wifi_anqp_request_callback_register(wifi_anqp_request_callback_t callback) {
              // Dummy implementation: just print a message and return success
              printf("ANQP request callback registered.\n");
              return 1;
          }
          
          // Example of a dummy callback function
          void anqpRequest_callback(int apIndex, mac_address_t sta, unsigned char token, wifi_anqp_node_t *list) {
              // Dummy callback implementation
              printf("ANQP request received for AP index: %d, token: %u\n", apIndex, token);
          }
          
          
          int wifi_anqpSendResponse(unsigned int apIndex, mac_address_t sta, unsigned char token, wifi_anqp_node_t *list)
          {
                  printf("Called  with apIndex: %d\n", apIndex);
               // Dummy implementation, just returning 1
              return 1;
          }
          
          int wifi_pushApInterworkingElement(int apIndex, wifi_InterworkingElement_t *infoElement) {
               printf("Called wifi_pushApInterworkingElement with apIndex: %d\n", apIndex);
               // Dummy implementation, just returning 1
              return 1;
          }
          
          // Dummy function implementation
          int wifi_pushApRoamingConsortiumElement(int apIndex, wifi_roamingConsortiumElement_t *infoElement) {
          // Log the input values (optional, for debugging)
              printf("Called wifi_pushApRoamingConsortiumElement with apIndex: %d\n", apIndex);
          
              // Optionally print contents of infoElement for debugging (if fields exist)
              if (infoElement != NULL) {
                  //printf("Info Element some_field: %d\n", infoElement->some_field);
              }
          
              // Dummy function, always returns true 
              return 1;
          }
          Note: Add all necessary structures

...