Search Linux Wireless

Re: [PATCH 02/10] rtw88: Enable 802.11ac beamformee support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



<yhchuang@xxxxxxxxxxx> writes:

> From: Tzu-En Huang <tehuang@xxxxxxxxxxx>
>
> Enable MU-MIMO transmit beamformee support for chipset 8822b and 8822c.
>
> If the rtw88 is in station mode and associated with an AP, and the
> capabilities of both meet the requirement of beamforming, driver will
> run as a beamformee and the corresponding chip settings will be set.
>
> In addition, module parameter support_bf is added to enable or disable
> beamforming.

Why do you need a module parameter? Module paramaters are not meant to
be replacement for ini files, where you have a setting to enable or
disable each future. Module parameters should be added only for really
good reasons.

> +void rtw_bf_assoc(struct rtw_dev *rtwdev, struct ieee80211_vif *vif,
> +		  struct ieee80211_bss_conf *bss_conf)
> +{
> +	struct ieee80211_hw *hw = rtwdev->hw;
> +	struct rtw_vif *rtwvif = (struct rtw_vif *)vif->drv_priv;
> +	struct rtw_bfee *bfee = &rtwvif->bfee;
> +	struct rtw_bf_info *bfinfo = &rtwdev->bf_info;
> +	struct rtw_chip_info *chip = rtwdev->chip;
> +	struct ieee80211_sta *sta;
> +	struct ieee80211_sta_vht_cap vht_cap;
> +	struct ieee80211_sta_vht_cap ic_vht_cap;
> +	u32 sound_dim;
> +	u8 *bssid, i;
> +
> +	if (chip->band & RTW_BAND_5G) {
> +		ic_vht_cap = hw->wiphy->bands[NL80211_BAND_5GHZ]->vht_cap;
> +		if (!(ic_vht_cap.cap &
> +		      (IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE |
> +		       IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE)))
> +			goto exit;
> +	} else {
> +		goto exit;
> +	}
> +
> +	bssid = (u8 *)bss_conf->bssid;

This cast looks very fishy, you are again casting away const. Like I
said in patch 1, avoid casts as much as possible. They are fragile and
can easily create bugs if you are not careful.

-- 
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux