> +/** > + * struct wiphy_radio_cfg - physical radio config of a wiphy > + * This structure describes the configurations of a physical radio in a > + * wiphy. It is used to denote per-radio attributes belonging to a wiphy. > Seems like there should be a blank line after the short description so it doesn't all end up in there? > + * @NL80211_ATTR_WIPHY_RADIO_INDEX: Integer attribute denoting the index of > + * the radio in interest. Internally a value of 0xff is used to indicate > + * this attribute is not present, and hence any associated attributes are > + * deemed to be applicable to all radios Please document the type here. Also, the description of the internal 0xff handling and all that is inappropriate in the public API documentation. However, it seems using -1, would be nicer? Also, NL80211_WIPHY_RADIO_ID_MAX is a _really_ bad name for that. > +++ b/net/wireless/core.c > @@ -1077,6 +1077,23 @@ int wiphy_register(struct wiphy *wiphy) > return res; > } > > + /* Allocate radio configuration space for multi-radio wiphy. > + */ > + if (wiphy->n_radio) { > + int idx; > + > + wiphy->radio_cfg = kcalloc(wiphy->n_radio, sizeof(*wiphy->radio_cfg), > + GFP_KERNEL); > + if (!wiphy->radio_cfg) > + return -ENOMEM; > + /* > + * Initialize wiphy radio parameters to IEEE 802.11 MIB default values. > + * RTS threshold is disabled by default with the special -1 value. > + */ > + for (idx = 0; idx < wiphy->n_radio; idx++) > + wiphy->radio_cfg[idx].rts_threshold = (u32)-1; > + } This error handling is obviously all wrong. Please ask someone else to review before you resubmit. The later code in nl80211.c could also use some refactoring, rather than just indent it a bit and call it done. johannes