Versions Compared

Key

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

...

draw.io Diagram
bordertrue
diagramNamewphy
simpleViewerfalse
width
linksauto
tbstyletop
lboxtrue
diagramWidth672
height201
revision3

Main Assumption:

The radio_interface_mapping_t structure part of wifi_hal_generic.h is used to define the mapping of phy to a particular radio along with the primary interface. Structure declaration is as below:

typedef struct {
    unsigned int phy_index;                  /* Phy Index */
    unsigned int radio_index;               /* Radio Index, 0 - 2.4G, 1 - 5G, 2 - 6G */
    char radio_name[16];                     /* Readable radio name */
    wifi_interface_name_t interface_name;  / Primary interface associated with the radio */
}__attribute__((packed)) radio_interface_mapping_t;

We will use this structure to map the multiple radio to the same phy.  

For e.g. in case of the current implementation, the elements of the structure for a 3 radio will be as below (indicating different phy index for different radio): 

{ 0, 0, "radio1", "wlan0"},

{ 1, 1,  "radio2", "wlan1"},

{ 2, 2, "radio3", "wlan2"},

In case of single phy, the elements of this structure for a 3 radio will have the same phy mapped to different radio index indicated in green.

{ 0, 0, "radio1", "wlan0"},

{ 0, 1,  "radio2", "wlan1"},

{ 0, 2, "radio3", "wlan2"},

Low Level Design Changes

This section will provide details on the changes in different modules to support Single wiphy usecase.

 rdk-wifi-hal

    • wiphy_dump_handler

      In wiphy_dump_handler, the global object g_wifi_hal's (an instance of wifi_hal_priv_t) is populated with the radio info associated with each phy.

      Here there is a function get_rdk_radio_index which takes in phy_index and provides a single radio_index as output. 

Proposed change:

Introduce a new function get_rdk_radio_indices replacing get_rdk_radio_index, which provides an array of rdk_radio_index associated with a particular phy_index. The array will be based on the defined radio_interface_mapping elements.

Use this array to populate the g_wifi_hal.radio_info.

    • get_radio_by_phy_index

This function takes input as phy_index and returns a single radio_info structure. In case of single phy, since there would be multiple radio_info associated with the same phy_index returning a single radio_info structure is incorrect. 

Proposed Change:

All the usage instances of this function was checked. We can remove the usage of this function and fully deprecate it with the below changes:

      • Interface_info_handler: get_radio_by_phy_index is used to get the radio_info instance in which the interface is updated into the hash_map. The right radio_info instance can be passed as an argument to this function in the nl80211_send_and_recv call where the interface_info_handler is passed as callback function pointer. 

The right radio info is then passed as arg to this function and can be accessed without calling get_radio_by_phy_index.

      • wiphy_get_info_handler: This function is passed as callback handler to nl80211_send_and_recv as part of nl80211_init_radio_info. This is called for each radio_info in the g_wifi_hal structure.
        • Pass radio_info as argument to the function nl80211_send_and_recv similar change as that of interface_info_handler.
        • In wiphy_get_info_handler, based on the band associated with radio_info process the right band in the nested bands sent with attribute NL80211_ATTR_WIPHY_BANDS. In nl80211, band mapping is defined as per enum nl80211_band.
      • remove_station_from_other_interfaces: Change interface_info structure to have rdk_index associated with this interface. Obtain the right radio_info structure using the function get_radio_by_rdk_index instead of get_radio_by_phy_index.
      • phy_info_handler: This function is passed as callback handler to nl80211_send_and_recv in update_channel_flags which does not use radio_info structure. In the phy_info_handler, based on the band obtained the channel flags has to be updated to the right radio_info structure.
      • wifi_hal_purgeScanResult: get_radio_by_phy_index was used to obtain the interface for purging the scan result. Simplify this by using get_interface_by_vap_index and remove the usage of get_radio_by_phy_index.
      • platform_get_radio_phytemperature: In broadcom platform.c file, get_radio_by_phy_index is called in this function. Instead of this function, obtain the appropriate radio_info pointer by calling get_radio_by_rdk_index.

Onewifi

    • Needs to check further whether there is any direct usage of phy_index instead of rdk_radio_index. Study in progress.

hostap 

    • No changes required in hostap patches.

References

...