linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] carl9170: advertise interface combinations
@ 2011-05-13 22:35 Christian Lamparter
  2011-05-13 23:28 ` Johannes Berg
  0 siblings, 1 reply; 5+ messages in thread
From: Christian Lamparter @ 2011-05-13 22:35 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg, linville

In order to provide multiple interfaces for a single device,
the driver is now required to advertise all possible
interface configurations to the stack.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
---
with the standard firmware, iw now displays:
	[...]
        valid interface combinations:
                 * #{ IBSS, managed, AP, P2P-client, P2P-GO } <= 2,
                   total <= 2, #channels <= 1
	[...]
---
diff --git a/drivers/net/wireless/ath/carl9170/carl9170.h b/drivers/net/wireless/ath/carl9170/carl9170.h
index 71d6d07..dbce999 100644
--- a/drivers/net/wireless/ath/carl9170/carl9170.h
+++ b/drivers/net/wireless/ath/carl9170/carl9170.h
@@ -287,6 +287,10 @@ struct ar9170 {
 		unsigned int tx_seq_table;
 	} fw;
 
+	/* interface configuration combinations */
+	struct ieee80211_iface_limit if_comb_limits[1];
+	struct ieee80211_iface_combination if_combs[1];
+
 	/* reset / stuck frames/queue detection */
 	struct work_struct restart_work;
 	struct work_struct ping_work;
diff --git a/drivers/net/wireless/ath/carl9170/fw.c b/drivers/net/wireless/ath/carl9170/fw.c
index 9517ede..8ec27b8 100644
--- a/drivers/net/wireless/ath/carl9170/fw.c
+++ b/drivers/net/wireless/ath/carl9170/fw.c
@@ -300,6 +300,17 @@ static int carl9170_fw(struct ar9170 *ar, const __u8 *data, size_t len)
 		}
 	}
 
+	ar->if_comb_limits[0].max = ar->fw.vif_num;
+	ar->if_comb_limits[0].types = ar->hw->wiphy->interface_modes;
+
+	ar->if_combs[0].num_different_channels = 1;
+	ar->if_combs[0].max_interfaces = ar->fw.vif_num;
+	ar->if_combs[0].limits = ar->if_comb_limits;
+	ar->if_combs[0].n_limits = ARRAY_SIZE(ar->if_comb_limits);
+
+	ar->hw->wiphy->iface_combinations = ar->if_combs;
+	ar->hw->wiphy->n_iface_combinations = ARRAY_SIZE(ar->if_combs);
+
 	txsq_desc = carl9170_fw_find_desc(ar, TXSQ_MAGIC,
 		sizeof(*txsq_desc), CARL9170FW_TXSQ_DESC_CUR_VER);
 

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-05-14  0:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-13 22:35 [PATCH] carl9170: advertise interface combinations Christian Lamparter
2011-05-13 23:28 ` Johannes Berg
2011-05-13 23:39   ` Christian Lamparter
2011-05-13 23:48     ` Johannes Berg
2011-05-14  0:42       ` [PATCH v2] " Christian Lamparter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).