Search Linux Wireless

Re: [patch 2/5] Add basic support for IEEE 802.11n discovery and association

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

 



On Mon, 2007-03-26 at 04:38 -0700, mohamed wrote:

> @@ -96,6 +96,10 @@ struct ieee802_11_elems {
>  	u8 rsn_len;
>  	u8 *erp_info;
>  	u8 erp_info_len;
> +	u8 *ht_cap_param;
> +	u8 ht_cap_param_len;
> +	u8 *ht_extra_param;
> +	u8 ht_extra_param_len;
>  	u8 *ext_supp_rates;
>  	u8 ext_supp_rates_len;
>  	u8 *wmm_info;

Random note not applicable to your patch: This is quite a large struct,
especially on 64-bit. Maybe we should be thinking about making those
pointers there u16 offsets instead. And we *definitely* should change
the order of these fields, having u8 and u8* alternate just sucks.

> +static void ieee80211_sta_ht_params(struct net_device *dev, 
> +			struct sta_info *sta,
> +			struct ieee80211_ht_additional_info *ht_extra_param,
> +			struct ieee80211_ht_capability *ht_cap_param)
> +{
> +	int rc;
> +	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
> +
> +	if (local->ops->conf_ht) {
> +		rc = local->ops->conf_ht(local_to_hw(local), ht_cap_param, 
> +					 ht_extra_param);
> +
> +		if (rc)
> +			sta->flags &= ~WLAN_STA_HT;
> +	} else 
> +		sta->flags &= ~WLAN_STA_HT;

Shouldn't this also set the STA_HT flag in the case where conf_ht
returns without error?

> +/* Get 11n capabilties from low level driver */
> +static void ieee80211_fill_ht_ie(struct net_device *dev,

[filling in how it looks like after Luis's and my proposed changes]

> +				 struct ieee80211_ht_capability *ht_capab)
> +{
> +       struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
> +       BUG_ON(!local->ops->get_ht_capab);
> +       memset(ht_capab, 0, sizeof(struct ieee80211_ht_capability));
> +       local->ops->get_ht_capab(local_to_hw(local), ht_capab);

some blank lines would be good ;)

Maybe we should be setting some fields to default values here that
aren't zero? Haven't checked.
 
> +	/* if low level driver support 11n fill in 11n IE */
> +	if (ht_enabled && ifsta->ht_enabled && local->ops->get_ht_capab) {
> +		pos = skb_put(skb, sizeof(struct ieee80211_ht_capability)+2);
> +		*pos++ = WLAN_EID_HT_CAPABILITY;
> +		*pos++ = sizeof(struct ieee80211_ht_capability);
> +		ieee80211_fill_ht_ie(dev, 
> +				     (struct ieee80211_ht_capability *)pos);

Now that fill_ht_ie is so short maybe it should just be rolled into this
code.

johannes

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux