aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-09-16 08:58:23 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-09-16 15:46:07 -0400
commit2ca27bcff7127da1aa7dd39cd2a6f7cb187e327f (patch)
treefae1b81c56763a53d432310b8fcbb81b9bb48d7e /include
parent074ac8df9f93f2a35a356d92fd7f16cd846f0a03 (diff)
mac80211: add p2p device type support
When a driver advertises p2p device support, mac80211 will handle it, but internally it will rewrite the interface type to STA/AP rather than P2P-STA/GO since otherwise a lot of paths need to be touched that are otherwise identical. A p2p boolean tells drivers whether or not a given interface will be used for p2p or not. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include')
-rw-r--r--include/net/mac80211.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 19a5cb4a6582..12a49f0ba32c 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -769,6 +769,8 @@ struct ieee80211_channel_switch {
769 * @bss_conf: BSS configuration for this interface, either our own 769 * @bss_conf: BSS configuration for this interface, either our own
770 * or the BSS we're associated to 770 * or the BSS we're associated to
771 * @addr: address of this interface 771 * @addr: address of this interface
772 * @p2p: indicates whether this AP or STA interface is a p2p
773 * interface, i.e. a GO or p2p-sta respectively
772 * @drv_priv: data area for driver use, will always be aligned to 774 * @drv_priv: data area for driver use, will always be aligned to
773 * sizeof(void *). 775 * sizeof(void *).
774 */ 776 */
@@ -776,6 +778,7 @@ struct ieee80211_vif {
776 enum nl80211_iftype type; 778 enum nl80211_iftype type;
777 struct ieee80211_bss_conf bss_conf; 779 struct ieee80211_bss_conf bss_conf;
778 u8 addr[ETH_ALEN]; 780 u8 addr[ETH_ALEN];
781 bool p2p;
779 /* must be last */ 782 /* must be last */
780 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); 783 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
781}; 784};
@@ -1701,7 +1704,7 @@ struct ieee80211_ops {
1701 struct ieee80211_vif *vif); 1704 struct ieee80211_vif *vif);
1702 int (*change_interface)(struct ieee80211_hw *hw, 1705 int (*change_interface)(struct ieee80211_hw *hw,
1703 struct ieee80211_vif *vif, 1706 struct ieee80211_vif *vif,
1704 enum nl80211_iftype new_type); 1707 enum nl80211_iftype new_type, bool p2p);
1705 void (*remove_interface)(struct ieee80211_hw *hw, 1708 void (*remove_interface)(struct ieee80211_hw *hw,
1706 struct ieee80211_vif *vif); 1709 struct ieee80211_vif *vif);
1707 int (*config)(struct ieee80211_hw *hw, u32 changed); 1710 int (*config)(struct ieee80211_hw *hw, u32 changed);
@@ -2721,4 +2724,26 @@ conf_is_ht(struct ieee80211_conf *conf)
2721 return conf->channel_type != NL80211_CHAN_NO_HT; 2724 return conf->channel_type != NL80211_CHAN_NO_HT;
2722} 2725}
2723 2726
2727static inline enum nl80211_iftype
2728ieee80211_iftype_p2p(enum nl80211_iftype type, bool p2p)
2729{
2730 if (p2p) {
2731 switch (type) {
2732 case NL80211_IFTYPE_STATION:
2733 return NL80211_IFTYPE_P2P_CLIENT;
2734 case NL80211_IFTYPE_AP:
2735 return NL80211_IFTYPE_P2P_GO;
2736 default:
2737 break;
2738 }
2739 }
2740 return type;
2741}
2742
2743static inline enum nl80211_iftype
2744ieee80211_vif_type_p2p(struct ieee80211_vif *vif)
2745{
2746 return ieee80211_iftype_p2p(vif->type, vif->p2p);
2747}
2748
2724#endif /* MAC80211_H */ 2749#endif /* MAC80211_H */