aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-04-05 12:42:02 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-07 15:51:38 -0400
commit3997ff39faa184a2ff670a6792cdb89ff51cf78f (patch)
tree04dc0167b5f70aa4b6d784b52f36aade4e78eb1d /drivers/net/wireless/iwlwifi/iwl-agn.c
parent7415952ff789b1c1878119662d4dc011ac9d261e (diff)
iwlagn: add feature flags
Some new devices and microcode files will a greater variety of features, so the TLV-per-feature approach we took before will quickly make things harder to manage and increase the file size. Add a new TLV that has feature flags. Currently, it will contain: 1) a PAN feature flag, which moves from a separate TLV 2) a new BT stats bit that indicates whether the microcode image uses bluetooth statistics 3) a new MFP flag for management frame protection which can be enabled once the device/microcode supports it Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 2f4fe16d1eea..30b8b9e1bc2e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1191,7 +1191,7 @@ static void iwl_nic_start(struct iwl_priv *priv)
1191struct iwlagn_ucode_capabilities { 1191struct iwlagn_ucode_capabilities {
1192 u32 max_probe_length; 1192 u32 max_probe_length;
1193 u32 standard_phy_calibration_size; 1193 u32 standard_phy_calibration_size;
1194 bool pan; 1194 u32 flags;
1195}; 1195};
1196 1196
1197static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context); 1197static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context);
@@ -1418,7 +1418,23 @@ static int iwlagn_load_firmware(struct iwl_priv *priv,
1418 case IWL_UCODE_TLV_PAN: 1418 case IWL_UCODE_TLV_PAN:
1419 if (tlv_len) 1419 if (tlv_len)
1420 goto invalid_tlv_len; 1420 goto invalid_tlv_len;
1421 capa->pan = true; 1421 capa->flags |= IWL_UCODE_TLV_FLAGS_PAN;
1422 break;
1423 case IWL_UCODE_TLV_FLAGS:
1424 /* must be at least one u32 */
1425 if (tlv_len < sizeof(u32))
1426 goto invalid_tlv_len;
1427 /* and a proper number of u32s */
1428 if (tlv_len % sizeof(u32))
1429 goto invalid_tlv_len;
1430 /*
1431 * This driver only reads the first u32 as
1432 * right now no more features are defined,
1433 * if that changes then either the driver
1434 * will not work with the new firmware, or
1435 * it'll not take advantage of new features.
1436 */
1437 capa->flags = le32_to_cpup((__le32 *)tlv_data);
1422 break; 1438 break;
1423 case IWL_UCODE_TLV_INIT_EVTLOG_PTR: 1439 case IWL_UCODE_TLV_INIT_EVTLOG_PTR:
1424 if (tlv_len != sizeof(u32)) 1440 if (tlv_len != sizeof(u32))
@@ -1681,12 +1697,16 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
1681 priv->cfg->base_params->max_event_log_size; 1697 priv->cfg->base_params->max_event_log_size;
1682 priv->_agn.inst_errlog_ptr = pieces.inst_errlog_ptr; 1698 priv->_agn.inst_errlog_ptr = pieces.inst_errlog_ptr;
1683 1699
1684 if (ucode_capa.pan) { 1700 if (ucode_capa.flags & IWL_UCODE_TLV_FLAGS_PAN) {
1685 priv->valid_contexts |= BIT(IWL_RXON_CTX_PAN); 1701 priv->valid_contexts |= BIT(IWL_RXON_CTX_PAN);
1686 priv->sta_key_max_num = STA_KEY_MAX_NUM_PAN; 1702 priv->sta_key_max_num = STA_KEY_MAX_NUM_PAN;
1687 } else 1703 } else
1688 priv->sta_key_max_num = STA_KEY_MAX_NUM; 1704 priv->sta_key_max_num = STA_KEY_MAX_NUM;
1689 1705
1706 if (ucode_capa.flags & IWL_UCODE_TLV_FLAGS_BTSTATS ||
1707 (priv->cfg->bt_params && priv->cfg->bt_params->bt_statistics))
1708 priv->bt_statistics = true;
1709
1690 /* Copy images into buffers for card's bus-master reads ... */ 1710 /* Copy images into buffers for card's bus-master reads ... */
1691 1711
1692 /* Runtime instructions (first block of data in file) */ 1712 /* Runtime instructions (first block of data in file) */
@@ -2827,6 +2847,9 @@ static int iwl_mac_setup_register(struct iwl_priv *priv,
2827 hw->flags |= IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS | 2847 hw->flags |= IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS |
2828 IEEE80211_HW_SUPPORTS_STATIC_SMPS; 2848 IEEE80211_HW_SUPPORTS_STATIC_SMPS;
2829 2849
2850 if (capa->flags & IWL_UCODE_TLV_FLAGS_MFP)
2851 hw->flags |= IEEE80211_HW_MFP_CAPABLE;
2852
2830 hw->sta_data_size = sizeof(struct iwl_station_priv); 2853 hw->sta_data_size = sizeof(struct iwl_station_priv);
2831 hw->vif_data_size = sizeof(struct iwl_vif_priv); 2854 hw->vif_data_size = sizeof(struct iwl_vif_priv);
2832 2855