Search Linux Wireless

Re: [PATCH v2 3/3] cfg80211: Add support for key operations on NL80211_IFTYPE_MLO_LINK

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

 



On Wed, 2022-02-23 at 16:16 +0530, Veerendranath Jakkam wrote:
> 
> --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
> +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
> @@ -1123,17 +1123,25 @@ void ath6kl_cfg80211_ch_switch_notify(struct ath6kl_vif *vif, int freq,
>  	mutex_unlock(&vif->wdev.mtx);
>  }
>  
> -static int ath6kl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev,
> +static int ath6kl_cfg80211_add_key(struct wiphy *wiphy,
> +				   struct wireless_dev *wdev,
>  				   u8 key_index, bool pairwise,
>  				   const u8 *mac_addr,
>  				   struct key_params *params)
>  {
> -	struct ath6kl *ar = ath6kl_priv(ndev);
> -	struct ath6kl_vif *vif = netdev_priv(ndev);
> +	struct ath6kl *ar;
> +	struct ath6kl_vif *vif;
>  	struct ath6kl_key *key = NULL;
>  	int seq_len;
>  	u8 key_usage;
>  	u8 key_type;
> +	struct net_device *ndev = wdev->netdev;
> +
> +	if (!ndev)
> +		return -EOPNOTSUPP;
> 

Rather than changing all the drivers in this way, it's probably better
to introduce a WIPHY flag "supports MLD" and allow a non-netdev wdev to
appear only when the flag is set?

That still changes the prototype from ndev to wdev, but doesn't require
the introduction of a lot of "!ndev" changes, which would be needed for
more operations, and probably we can then just add a single line

	struct net_device *ndev = wdev->netdev;

at the beginning of the variable initializer block (even with spatch), 
without changing everything else.

Seems nicer? What do you think?

johannes



[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