staging: rtl8723bs: remove unused network_type_in_use field
PATCH 1/1 staging: rtl8723bs: remove unused network_type_in_use field
The network_type_in_use member of struct wlan_bssid_ex is write-only:
nothing in the driver ever reads it. It is assigned in three places, none of which feed anything:
- collect_bss_info() hard-codes it to Ndis802_11OFDM24 for every parsed beacon/probe response, regardless of the network's actual band or rates (it is even wrong for 5 GHz APs, which the same function explicitly handles).
- rtw_check_beacon_data() and rtw_update_registrypriv_dev_network() derive it from the wireless mode via a switch, but the result is likewise never consumed.
The live PHY classification the driver actually acts on is kept in wlan_network.network_type (the WIRELESS_11x value), so this NDIS-era field is redundant.
struct wlan_bssid_ex is an internal structure passed by pointer through the driver command queue; it is never serialized to firmware or onto the air (the wire data lives in ies[]), so dropping a member is layout-safe as long as the module is rebuilt as a whole.
enum ndis_802_11_network_type existed only to type this field, so remove it as well. No functional change.
--- drivers/staging/rtl8723bs/core/rtw_ap.c | 15 --------------- drivers/staging/rtl8723bs/core/rtw_mlme.c | 16 ---------------- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 2 -- drivers/staging/rtl8723bs/include/wlan_bssdef.h | 11 +---------- 4 files changed, 1 insertion(+), 43 deletions(-)
drivers/staging/rtl8723bs/core/rtw_ap.c +0 -15
@@ -1056,21 +1056,6 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)if (p && ie_len >0 ) pHT_info_ie = p; -switch (network_type) { -case WIRELESS_11B : - pbss_network->network_type_in_use = Ndis802_11DS; -break ; -case WIRELESS_11G : -case WIRELESS_11BG : -case WIRELESS_11G_24N : -case WIRELESS_11BG_24N : - pbss_network->network_type_in_use = Ndis802_11OFDM24; -break ; -default : - pbss_network->network_type_in_use = Ndis802_11OFDM24; -break ; - } - pmlmepriv->cur_network.network_type = network_type; pmlmepriv->htpriv.ht_option = false;
drivers/staging/rtl8723bs/core/rtw_mlme.c +0 -16
@@ -2127,22 +2127,6 @@ void rtw_update_registrypriv_dev_network(struct adapter *adapter) pdev_network->rssi =0 ; -switch (pregistrypriv->wireless_mode) { -case WIRELESS_11B : - pdev_network->network_type_in_use = (Ndis802_11DS); -break ; -case WIRELESS_11G : -case WIRELESS_11BG : -case WIRELESS_11_24N : -case WIRELESS_11G_24N : -case WIRELESS_11BG_24N : - pdev_network->network_type_in_use = (Ndis802_11OFDM24); -break ; -default : -/* TODO */ -break ; - } - pdev_network->configuration.ds_config = (pregistrypriv->channel);if (cur_network->network.infrastructure_mode == Ndis802_11IBSS)
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +0 -2
@@ -3971,8 +3971,6 @@ u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame, strmemcpy (bssid->supported_rates + i, (p +2 ), len); } - bssid->network_type_in_use = Ndis802_11OFDM24; -if (bssid->ie_length <12 )return _FAIL;
drivers/staging/rtl8723bs/include/wlan_bssdef.h +1 -10
@@ -23,14 +23,6 @@ struct ndis_802_11_ssid {u8 ssid[32 ]; }; -enum ndis_802_11_network_type { - Ndis802_11FH, - Ndis802_11DS, - Ndis802_11OFDM5, - Ndis802_11OFDM24, - Ndis802_11NetworkTypeMax/* not a real type, defined as an upper bound */ -}; -/* FW will only save the channel number in DSConfig. ODI Handler will convert the channel number to freq. number.
@@ -65,7 +57,7 @@ struct ndis_80211_var_ie {/* Length is the 4 bytes multiples of the sum of * ETH_ALEN + 2 + * sizeof (struct ndis_802_11_ssid) + sizeof (u32) + -* sizeof (long) + sizeof (enum ndis_802_11_network_type) + +* sizeof (long) + * sizeof (struct ndis_802_11_conf) + sizeof (NDIS_802_11_RATES_EX) + ie_length * * Except for ie_length, all other fields are fixed length. Therefore, we can
@@ -159,7 +151,6 @@ struct wlan_bssid_ex {struct ndis_802_11_ssid ssid;u32 privacy;long rssi;/* in dBM, raw data , get from PHY) */ -enum ndis_802_11_network_type network_type_in_use;struct ndis_802_11_conf configuration;enum ndis_802_11_network_infrastructure infrastructure_mode;NDIS_802_11_RATES_EX supported_rates;
Signature · 1 line
2.25.1