diff options
author | Christian Lamparter <chunkeey@googlemail.com> | 2011-05-13 20:42:38 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-05-16 14:25:28 -0400 |
commit | df64962f7d74877624442c059e7878fdf7ec3c22 (patch) | |
tree | beb4c46b24f64add4819b293659854eb2b3ed01e /drivers | |
parent | dedb1eb977d75f301b17190cc4b6e7d17dbf17db (diff) |
carl9170: advertise interface combinations
In order to provide multiple interfaces for a single device,
the driver will be required to advertise all possible
interface configurations to the stack.
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath/carl9170/carl9170.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ath/carl9170/fw.c | 19 | ||||
-rw-r--r-- | drivers/net/wireless/ath/carl9170/main.c | 10 |
3 files changed, 24 insertions, 9 deletions
diff --git a/drivers/net/wireless/ath/carl9170/carl9170.h b/drivers/net/wireless/ath/carl9170/carl9170.h index beb725d7547f..771c0217ea6a 100644 --- a/drivers/net/wireless/ath/carl9170/carl9170.h +++ b/drivers/net/wireless/ath/carl9170/carl9170.h | |||
@@ -286,6 +286,10 @@ struct ar9170 { | |||
286 | unsigned int tx_seq_table; | 286 | unsigned int tx_seq_table; |
287 | } fw; | 287 | } fw; |
288 | 288 | ||
289 | /* interface configuration combinations */ | ||
290 | struct ieee80211_iface_limit if_comb_limits[1]; | ||
291 | struct ieee80211_iface_combination if_combs[1]; | ||
292 | |||
289 | /* reset / stuck frames/queue detection */ | 293 | /* reset / stuck frames/queue detection */ |
290 | struct work_struct restart_work; | 294 | struct work_struct restart_work; |
291 | struct work_struct ping_work; | 295 | struct work_struct ping_work; |
diff --git a/drivers/net/wireless/ath/carl9170/fw.c b/drivers/net/wireless/ath/carl9170/fw.c index 9517ede9e2df..221957c5d373 100644 --- a/drivers/net/wireless/ath/carl9170/fw.c +++ b/drivers/net/wireless/ath/carl9170/fw.c | |||
@@ -151,6 +151,7 @@ static int carl9170_fw(struct ar9170 *ar, const __u8 *data, size_t len) | |||
151 | const struct carl9170fw_chk_desc *chk_desc; | 151 | const struct carl9170fw_chk_desc *chk_desc; |
152 | const struct carl9170fw_last_desc *last_desc; | 152 | const struct carl9170fw_last_desc *last_desc; |
153 | const struct carl9170fw_txsq_desc *txsq_desc; | 153 | const struct carl9170fw_txsq_desc *txsq_desc; |
154 | u16 if_comb_types; | ||
154 | 155 | ||
155 | last_desc = carl9170_fw_find_desc(ar, LAST_MAGIC, | 156 | last_desc = carl9170_fw_find_desc(ar, LAST_MAGIC, |
156 | sizeof(*last_desc), CARL9170FW_LAST_DESC_CUR_VER); | 157 | sizeof(*last_desc), CARL9170FW_LAST_DESC_CUR_VER); |
@@ -268,6 +269,9 @@ static int carl9170_fw(struct ar9170 *ar, const __u8 *data, size_t len) | |||
268 | if (SUPP(CARL9170FW_WOL)) | 269 | if (SUPP(CARL9170FW_WOL)) |
269 | device_set_wakeup_enable(&ar->udev->dev, true); | 270 | device_set_wakeup_enable(&ar->udev->dev, true); |
270 | 271 | ||
272 | if_comb_types = BIT(NL80211_IFTYPE_STATION) | | ||
273 | BIT(NL80211_IFTYPE_P2P_CLIENT); | ||
274 | |||
271 | ar->fw.vif_num = otus_desc->vif_num; | 275 | ar->fw.vif_num = otus_desc->vif_num; |
272 | ar->fw.cmd_bufs = otus_desc->cmd_bufs; | 276 | ar->fw.cmd_bufs = otus_desc->cmd_bufs; |
273 | ar->fw.address = le32_to_cpu(otus_desc->fw_address); | 277 | ar->fw.address = le32_to_cpu(otus_desc->fw_address); |
@@ -294,12 +298,25 @@ static int carl9170_fw(struct ar9170 *ar, const __u8 *data, size_t len) | |||
294 | ar->hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_ADHOC); | 298 | ar->hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_ADHOC); |
295 | 299 | ||
296 | if (SUPP(CARL9170FW_WLANTX_CAB)) { | 300 | if (SUPP(CARL9170FW_WLANTX_CAB)) { |
297 | ar->hw->wiphy->interface_modes |= | 301 | if_comb_types |= |
298 | BIT(NL80211_IFTYPE_AP) | | 302 | BIT(NL80211_IFTYPE_AP) | |
299 | BIT(NL80211_IFTYPE_P2P_GO); | 303 | BIT(NL80211_IFTYPE_P2P_GO); |
300 | } | 304 | } |
301 | } | 305 | } |
302 | 306 | ||
307 | ar->if_comb_limits[0].max = ar->fw.vif_num; | ||
308 | ar->if_comb_limits[0].types = if_comb_types; | ||
309 | |||
310 | ar->if_combs[0].num_different_channels = 1; | ||
311 | ar->if_combs[0].max_interfaces = ar->fw.vif_num; | ||
312 | ar->if_combs[0].limits = ar->if_comb_limits; | ||
313 | ar->if_combs[0].n_limits = ARRAY_SIZE(ar->if_comb_limits); | ||
314 | |||
315 | ar->hw->wiphy->iface_combinations = ar->if_combs; | ||
316 | ar->hw->wiphy->n_iface_combinations = ARRAY_SIZE(ar->if_combs); | ||
317 | |||
318 | ar->hw->wiphy->interface_modes |= if_comb_types; | ||
319 | |||
303 | txsq_desc = carl9170_fw_find_desc(ar, TXSQ_MAGIC, | 320 | txsq_desc = carl9170_fw_find_desc(ar, TXSQ_MAGIC, |
304 | sizeof(*txsq_desc), CARL9170FW_TXSQ_DESC_CUR_VER); | 321 | sizeof(*txsq_desc), CARL9170FW_TXSQ_DESC_CUR_VER); |
305 | 322 | ||
diff --git a/drivers/net/wireless/ath/carl9170/main.c b/drivers/net/wireless/ath/carl9170/main.c index 7d5c65ea94e6..54d093c2ab44 100644 --- a/drivers/net/wireless/ath/carl9170/main.c +++ b/drivers/net/wireless/ath/carl9170/main.c | |||
@@ -1570,14 +1570,8 @@ void *carl9170_alloc(size_t priv_size) | |||
1570 | INIT_LIST_HEAD(&ar->vif_list); | 1570 | INIT_LIST_HEAD(&ar->vif_list); |
1571 | init_completion(&ar->tx_flush); | 1571 | init_completion(&ar->tx_flush); |
1572 | 1572 | ||
1573 | /* | 1573 | /* firmware decides which modes we support */ |
1574 | * Note: | 1574 | hw->wiphy->interface_modes = 0; |
1575 | * IBSS/ADHOC and AP mode are only enabled, if the firmware | ||
1576 | * supports these modes. The code which will add the | ||
1577 | * additional interface_modes is in fw.c. | ||
1578 | */ | ||
1579 | hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | | ||
1580 | BIT(NL80211_IFTYPE_P2P_CLIENT); | ||
1581 | 1575 | ||
1582 | hw->flags |= IEEE80211_HW_RX_INCLUDES_FCS | | 1576 | hw->flags |= IEEE80211_HW_RX_INCLUDES_FCS | |
1583 | IEEE80211_HW_REPORTS_TX_ACK_STATUS | | 1577 | IEEE80211_HW_REPORTS_TX_ACK_STATUS | |