On 28-2-2016 12:35, Eliad Peller wrote: > hi Arend, > > On Fri, Feb 26, 2016 at 10:59 PM, Arend van Spriel <arend@xxxxxxxxxxxx> wrote: >> Introducing a new feature that the driver can use to >> indicate the driver/firmware supports configuration of BSS >> selection criteria upon CONNECT command. This can be useful >> when multiple BSS-es are found belonging to the same ESS, >> ie. Infra-BSS with same SSID. The criteria can then be used to >> offload selection of a preferred BSS. >> > [...] > >> >> +/** >> + * struct nl80211_bss_select_rssi_adjust - RSSI adjustment parameters. >> + * >> + * @band: band of BSS that must match for RSSI value adjustment. >> + * @delta: value used to adjust the RSSI value of matching BSS. >> + */ >> +struct nl80211_bss_select_rssi_adjust { >> + enum nl80211_band band; >> + __s8 delta; >> +} __attribute__((packed)); >> + > i think enum can't be considered as fixed-size field, so better use u8 or so. Yeah. I was wondering about that as it may be affected by compiler option. Will change it to u8. >> @@ -626,6 +626,10 @@ int wiphy_register(struct wiphy *wiphy) >> !rdev->ops->set_mac_acl))) >> return -EINVAL; >> >> + if (WARN_ON(wiphy->bss_select_support && >> + (wiphy->bss_select_support & ~(BIT(__NL80211_BSS_SELECT_ATTR_AFTER_LAST) - 2)))) >> + return -EINVAL; >> + > worth noting that the "-2" counts for the invalid enum value (at least > it wasn't clear to me) I did have a comment in here in an earlier patch set or it was just a thought ;-) Will add a remark here. >> @@ -7995,6 +8086,21 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info) >> return -EOPNOTSUPP; >> } >> >> + /* only do bss selection when no BSSID is specified. */ >> + if (!connect.bssid && wiphy->bss_select_support && >> + info->attrs[NL80211_ATTR_BSS_SELECT]) { > > you don't have to check wiphy->bss_select_support here - we actually > want to fail if NL80211_ATTR_BSS_SELECT was given although the driver > doesn't support it. I agree failing would be better than silently ignoring. Will remove it. >> + err = parse_bss_select(info->attrs[NL80211_ATTR_BSS_SELECT], >> + wiphy, &connect.bss_select); >> + if (err) { >> + kzfree(connkeys); >> + return err; >> + } >> + if (!(wiphy->bss_select_support & BIT(connect.bss_select.behaviour))) { > > (it will fail here instead) Yup. Thanks for the review. Regards, Arend -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html