ath10k: advertise p2p dev support
authorMichal Kazior <michal.kazior@tieto.com>
Fri, 12 Dec 2014 11:41:39 +0000 (12:41 +0100)
committerKalle Valo <kvalo@qca.qualcomm.com>
Tue, 16 Dec 2014 07:26:04 +0000 (09:26 +0200)
Firmware doesn't allow precise tx rate control so
P2P wasn't entirely spec compliant (it was using
CCK rates in some cases).

The only way to make sure firmware doesn't use CCK
rates is to have a vdev with P2P subtype used for
scanning and tx. This can be done via a special
dedicated P2P device interface support.

This also removes the ancient hack from ath10k in
favor of p2pdev.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/core.c
drivers/net/wireless/ath/ath10k/mac.c

index 577a3d76df22534f747b15953b89354c85403967..c83f1e7f8029a3dff7f540949be91cfb72954c9f 100644 (file)
 
 unsigned int ath10k_debug_mask;
 static bool uart_print;
-static unsigned int ath10k_p2p;
 static bool skip_otp;
 
 module_param_named(debug_mask, ath10k_debug_mask, uint, 0644);
 module_param(uart_print, bool, 0644);
-module_param_named(p2p, ath10k_p2p, uint, 0644);
 module_param(skip_otp, bool, 0644);
 
 MODULE_PARM_DESC(debug_mask, "Debugging mask");
 MODULE_PARM_DESC(uart_print, "Uart target debugging");
-MODULE_PARM_DESC(p2p, "Enable ath10k P2P support");
 MODULE_PARM_DESC(skip_otp, "Skip otp failure for calibration in testmode");
 
 static const struct ath10k_hw_params ath10k_hw_params_list[] = {
@@ -1290,10 +1287,7 @@ struct ath10k *ath10k_core_create(size_t priv_size, struct device *dev,
 
        ar->ath_common.priv = ar;
        ar->ath_common.hw = ar->hw;
-
-       ar->p2p = !!ath10k_p2p;
        ar->dev = dev;
-
        ar->hif.ops = hif_ops;
        ar->hif.bus = bus;
 
index 19ddbc6e19e07a928d2d04966281a4029580638d..42f6a4ddeb5eb867293c39863c95911d082bb566 100644 (file)
@@ -2961,10 +2961,11 @@ static int ath10k_add_interface(struct ieee80211_hw *hw,
        arvif->vdev_id = bit;
        arvif->vdev_subtype = WMI_VDEV_SUBTYPE_NONE;
 
-       if (ar->p2p)
-               arvif->vdev_subtype = WMI_VDEV_SUBTYPE_P2P_DEVICE;
-
        switch (vif->type) {
+       case NL80211_IFTYPE_P2P_DEVICE:
+               arvif->vdev_type = WMI_VDEV_TYPE_STA;
+               arvif->vdev_subtype = WMI_VDEV_SUBTYPE_P2P_DEVICE;
+               break;
        case NL80211_IFTYPE_UNSPECIFIED:
        case NL80211_IFTYPE_STATION:
                arvif->vdev_type = WMI_VDEV_TYPE_STA;
@@ -4860,6 +4861,10 @@ static const struct ieee80211_iface_limit ath10k_if_limits[] = {
        .types  = BIT(NL80211_IFTYPE_P2P_GO)
        },
        {
+       .max    = 1,
+       .types  = BIT(NL80211_IFTYPE_P2P_DEVICE)
+       },
+       {
        .max    = 7,
        .types  = BIT(NL80211_IFTYPE_AP)
        },
@@ -5079,6 +5084,7 @@ int ath10k_mac_register(struct ath10k *ar)
 
        if (!test_bit(ATH10K_FW_FEATURE_NO_P2P, ar->fw_features))
                ar->hw->wiphy->interface_modes |=
+                       BIT(NL80211_IFTYPE_P2P_DEVICE) |
                        BIT(NL80211_IFTYPE_P2P_CLIENT) |
                        BIT(NL80211_IFTYPE_P2P_GO);