Skip to contentSkip to conversation

support for antenna configuration profiles

PATCH New Daniel Golle 1 participant 1 message Nov 28, 2011 802.11 (including cfg80211/NL80211)

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 support for antenna configuration profiles

This adds support for antenna switch configuration profiles to nl80211.

---
 include/linux/nl80211.h |   47 +++++++++++++++++++++++++++++++
 include/net/cfg80211.h  |   26 +++++++++++++++++
 net/wireless/nl80211.c  |   71 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 144 insertions(+), 0 deletions(-)
include/linux/nl80211.h +47 -0
index 97bfebf..0653896 100644
@@ -1185,6 +1185,12 @@ enum nl80211_commands {
  *    abides to when initiating radiation on DFS channels. A country maps
  *    to one DFS region.
  *
+ * @NL80211_ATTR_WIPHY_EXTANT: External antenna switch profiles. This nested
+ *	structure contains a list of available profiles as well as the current
+ *	profile selection status.
+ *
+ * @NL80211_ATTR_WIPHY_EXTANT_SELECT: Select extant profile.
+ *
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
  */
@@ -1428,6 +1434,9 @@ enum nl80211_attrs {
 	NL80211_ATTR_DISABLE_HT,
 	NL80211_ATTR_HT_CAPABILITY_MASK,
 
+	NL80211_ATTR_WIPHY_EXTANT,
+	NL80211_ATTR_WIPHY_EXTANT_SELECT,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,
@@ -1720,6 +1729,44 @@ enum nl80211_mpath_info {
 	NL80211_MPATH_INFO_MAX = __NL80211_MPATH_INFO_AFTER_LAST - 1
 };
 
+
+
+/**
+ * enum nl80211_extant_attr - external antenna switch
+ * @__NL80211_EXTANT_ATTR_INVALID: attribute number 0 is reserved
+ * @NL80211_EXTANT_ATTR_STATE: currently selected profile
+ * @NL80211_EXTANT_ATTR_PROFILES: highest profile attribute currently defined
+ * @NL80211_EXTANT_ATTR_MAX: highest profile attribute currently defined
+ * @__NL80211_EXTANT_ATTR_AFTER_LAST: internal use
+ */
+enum nl80211_extant_attr {
+	__NL80211_EXTANT_ATTR_INVALID,
+	NL80211_EXTANT_ATTR_STATE,
+	NL80211_EXTANT_ATTR_PROFILES,
+	/* keep last */
+	__NL80211_EXTANT_ATTR_AFTER_LAST,
+	NL80211_EXTANT_ATTR_MAX = __NL80211_EXTANT_ATTR_AFTER_LAST - 1
+};
+
+/**
+ * enum nl80211_easp_attr - external antenna switch configuration profile
+ * @__NL80211_EASP_ATTR_INVALID: attribute number 0 is reserved
+ * @NL80211_EASP_ATTR_ID: unique identifier
+ * @NL80211_EASP_ATTR_NAME: human-readable name of the configuration profile
+ * @NL80211_EASP_ATTR_DESC: human-readable description of the configuration profile
+ * @NL80211_EASP_ATTR_MAX: highest profile attribute currently defined
+ * @__NL80211_EASP_ATTR_AFTER_LAST: internal use
+ */
+enum nl80211_easp_attr {
+	__NL80211_EASP_ATTR_INVALID,
+	NL80211_EASP_ATTR_ID,
+	NL80211_EASP_ATTR_NAME,
+	NL80211_EASP_ATTR_DESC,
+	/* keep last */
+	__NL80211_EASP_ATTR_AFTER_LAST,
+	NL80211_EASP_ATTR_MAX = __NL80211_EASP_ATTR_AFTER_LAST - 1
+};
+
 /**
  * enum nl80211_band_attr - band attributes
  * @__NL80211_BAND_ATTR_INVALID: attribute number 0 is reserved
include/net/cfg80211.h +26 -0
index d5e1891..4896e7a 100644
@@ -1456,6 +1456,9 @@ struct cfg80211_gtk_rekey_data {
  *
  * @get_antenna: Get current antenna configuration from device (tx_ant, rx_ant).
  *
+ * @set_extant: Select the external antenna switch configuration profile.
+ * @get_extant: Get currently selected antenna switch profile.
+ *
  * @set_ringparam: Set tx and rx ring sizes.
  *
  * @get_ringparam: Get tx and rx ring current and maximum sizes.
@@ -1637,6 +1640,9 @@ struct cfg80211_ops {
 	int	(*set_antenna)(struct wiphy *wiphy, u32 tx_ant, u32 rx_ant);
 	int	(*get_antenna)(struct wiphy *wiphy, u32 *tx_ant, u32 *rx_ant);
 
+	int	(*set_extant)(struct wiphy *wiphy, u32 extant);
+	int	(*get_extant)(struct wiphy *wiphy, u32 *extant);
+
 	int	(*set_ringparam)(struct wiphy *wiphy, u32 tx, u32 rx);
 	void	(*get_ringparam)(struct wiphy *wiphy,
 				 u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max);
@@ -1748,6 +1754,7 @@ enum wiphy_flags {
 	WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD	= BIT(19),
 	WIPHY_FLAG_OFFCHAN_TX			= BIT(20),
 	WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL	= BIT(21),
+	WIPHY_FLAG_HAS_EXTANT_SWITCH		= BIT(22),
 };
 
 /**
@@ -1875,6 +1882,21 @@ struct wiphy_wowlan_support {
 };
 
 /**
+ * struct wiphy_extant_profile - User-parsable external antenna switch info
+ *
+ * This structure is used to provide the available switch configurations.
+ * @id: unique identifier of the profile
+ * @name: profile name (a short string)
+ * @description: user-parsable description of the profile
+ */
+struct wiphy_extant_profile {
+	int id;
+	char *name;
+	char *desc;
+};
+
+
+/**
  * struct wiphy - wireless hardware description
  * @reg_notifier: the driver's regulatory notification callback,
  *	note that if your driver uses wiphy_apply_custom_regulatory()
@@ -1955,6 +1977,8 @@ struct wiphy_wowlan_support {
  *	configured as RX antennas. Antenna configuration commands will be
  *	rejected unless this or @available_antennas_tx is set.
  *
+ * @extant: struct holding the available antenna switch configuration profiles.
+ *
  * @max_remain_on_channel_duration: Maximum time a remain-on-channel operation
  *	may request, if implemented.
  *
@@ -2025,6 +2049,8 @@ struct wiphy {
 	 */
 	u32 probe_resp_offload;
 
+	struct wiphy_extant_profile *extant;
+
 	/* If multiple wiphys are registered and you're handed e.g.
 	 * a regular netdev with assigned ieee80211_ptr, you won't
 	 * know whether it points to a wiphy your driver has registered
net/wireless/nl80211.c +71 -0

101 lines not on this page · raw message

Signature · 9 lines
1.7.4.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
Url : http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20111128/07a0d3c2/attachment-0001.pgp