]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/net/wireless.h
net: struct device - replace bus_id with dev_name(), dev_set_name()
[linux-2.6-omap-h63xx.git] / include / net / wireless.h
index 1dc8ec3daa2ff6fcf0fad9857d40354d6cccf6f9..412351560b764453570062387e835ad61a95cf29 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/netdevice.h>
 #include <linux/debugfs.h>
 #include <linux/list.h>
+#include <linux/ieee80211.h>
 #include <net/cfg80211.h>
 
 /**
@@ -60,6 +61,7 @@ enum ieee80211_channel_flags {
  * with cfg80211.
  *
  * @center_freq: center frequency in MHz
+ * @max_bandwidth: maximum allowed bandwidth for this channel, in MHz
  * @hw_value: hardware-specific value for the channel
  * @flags: channel flags from &enum ieee80211_channel_flags.
  * @orig_flags: channel flags at registration time, used by regulatory
@@ -73,6 +75,7 @@ enum ieee80211_channel_flags {
 struct ieee80211_channel {
        enum ieee80211_band band;
        u16 center_freq;
+       u8 max_bandwidth;
        u16 hw_value;
        u32 flags;
        int max_antenna_gain;
@@ -131,23 +134,23 @@ struct ieee80211_rate {
 };
 
 /**
- * struct ieee80211_ht_info - describing STA's HT capabilities
+ * struct ieee80211_sta_ht_cap - STA's HT capabilities
  *
  * This structure describes most essential parameters needed
  * to describe 802.11n HT capabilities for an STA.
  *
- * @ht_supported: is HT supported by STA, 0: no, 1: yes
+ * @ht_supported: is HT supported by the STA
  * @cap: HT capabilities map as described in 802.11n spec
  * @ampdu_factor: Maximum A-MPDU length factor
  * @ampdu_density: Minimum A-MPDU spacing
- * @supp_mcs_set: Supported MCS set as described in 802.11n spec
+ * @mcs: Supported MCS rates
  */
-struct ieee80211_ht_info {
+struct ieee80211_sta_ht_cap {
        u16 cap; /* use IEEE80211_HT_CAP_ */
-       u8 ht_supported;
+       bool ht_supported;
        u8 ampdu_factor;
        u8 ampdu_density;
-       u8 supp_mcs_set[16];
+       struct ieee80211_mcs_info mcs;
 };
 
 /**
@@ -171,13 +174,14 @@ struct ieee80211_supported_band {
        enum ieee80211_band band;
        int n_channels;
        int n_bitrates;
-       struct ieee80211_ht_info ht_info;
+       struct ieee80211_sta_ht_cap ht_cap;
 };
 
 /**
  * struct wiphy - wireless hardware description
  * @idx: the wiphy index assigned to this item
  * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name>
+ * @reg_notifier: the driver's regulatory notification callback
  */
 struct wiphy {
        /* assign these fields before you register the wiphy */
@@ -197,6 +201,9 @@ struct wiphy {
 
        struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS];
 
+       /* Lets us get back the wiphy on the callback */
+       int (*reg_notifier)(struct wiphy *wiphy, enum reg_set_by setby);
+
        /* fields below are read-only, assigned by cfg80211 */
 
        /* the item in /sys/class/ieee80211/ points to this,
@@ -217,9 +224,11 @@ struct wiphy {
  * the netdev.)
  *
  * @wiphy: pointer to hardware description
+ * @iftype: interface type
  */
 struct wireless_dev {
        struct wiphy *wiphy;
+       enum nl80211_iftype iftype;
 
        /* private to the generic wireless code */
        struct list_head list;
@@ -254,9 +263,9 @@ static inline struct device *wiphy_dev(struct wiphy *wiphy)
 /**
  * wiphy_name - get wiphy name
  */
-static inline char *wiphy_name(struct wiphy *wiphy)
+static inline const char *wiphy_name(struct wiphy *wiphy)
 {
-       return wiphy->dev.bus_id;
+       return dev_name(&wiphy->dev);
 }
 
 /**
@@ -322,7 +331,6 @@ extern int ieee80211_frequency_to_channel(int freq);
  */
 extern struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy,
                                                         int freq);
-
 /**
  * ieee80211_get_channel - get channel struct from wiphy for specified frequency
  */
@@ -331,4 +339,38 @@ ieee80211_get_channel(struct wiphy *wiphy, int freq)
 {
        return __ieee80211_get_channel(wiphy, freq);
 }
+
+/**
+ * ieee80211_get_response_rate - get basic rate for a given rate
+ *
+ * @sband: the band to look for rates in
+ * @basic_rates: bitmap of basic rates
+ * @bitrate: the bitrate for which to find the basic rate
+ *
+ * This function returns the basic rate corresponding to a given
+ * bitrate, that is the next lower bitrate contained in the basic
+ * rate map, which is, for this function, given as a bitmap of
+ * indices of rates in the band's bitrate table.
+ */
+struct ieee80211_rate *
+ieee80211_get_response_rate(struct ieee80211_supported_band *sband,
+                           u64 basic_rates, int bitrate);
+
+/**
+ * regulatory_hint - driver hint to the wireless core a regulatory domain
+ * @wiphy: the wireless device giving the hint (used only for reporting
+ *     conflicts)
+ * @alpha2: the ISO/IEC 3166 alpha2 the driver claims its regulatory domain
+ *     should be in. If @rd is set this should be NULL. Note that if you
+ *     set this to NULL you should still set rd->alpha2 to some accepted
+ *     alpha2.
+ *
+ * Wireless drivers can use this function to hint to the wireless core
+ * what it believes should be the current regulatory domain by
+ * giving it an ISO/IEC 3166 alpha2 country code it knows its regulatory
+ * domain should be in or by providing a completely build regulatory domain.
+ * If the driver provides an ISO/IEC 3166 alpha2 userspace will be queried
+ * for a regulatory domain structure for the respective country.
+ */
+extern void regulatory_hint(struct wiphy *wiphy, const char *alpha2);
 #endif /* __NET_WIRELESS_H */