aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReinette Chatre <reinette.chatre@intel.com>2009-10-16 17:25:53 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-27 16:48:32 -0400
commitf0b6e2e8cbc6026d3d6d3087032f5eceafaee0b8 (patch)
treeac5c02400b1ec5610e5f6b39e844489e9a8c394f
parent3ab312a893bbfc0fad7b1b644b3d477905773b1a (diff)
iwlwifi: move iwl_setup_mac to iwlagn
This function is only used in iwlagn so there is no need to have it in iwlcore. Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c62
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c58
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h1
3 files changed, 62 insertions, 59 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index fc7a51144f0c..6c4fa011a924 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2284,6 +2284,68 @@ void iwl_post_associate(struct iwl_priv *priv)
2284 2284
2285#define UCODE_READY_TIMEOUT (4 * HZ) 2285#define UCODE_READY_TIMEOUT (4 * HZ)
2286 2286
2287/*
2288 * Not a mac80211 entry point function, but it fits in with all the
2289 * other mac80211 functions grouped here.
2290 */
2291static int iwl_setup_mac(struct iwl_priv *priv)
2292{
2293 int ret;
2294 struct ieee80211_hw *hw = priv->hw;
2295 hw->rate_control_algorithm = "iwl-agn-rs";
2296
2297 /* Tell mac80211 our characteristics */
2298 hw->flags = IEEE80211_HW_SIGNAL_DBM |
2299 IEEE80211_HW_NOISE_DBM |
2300 IEEE80211_HW_AMPDU_AGGREGATION |
2301 IEEE80211_HW_SPECTRUM_MGMT;
2302
2303 if (!priv->cfg->broken_powersave)
2304 hw->flags |= IEEE80211_HW_SUPPORTS_PS |
2305 IEEE80211_HW_SUPPORTS_DYNAMIC_PS;
2306
2307 hw->wiphy->interface_modes =
2308 BIT(NL80211_IFTYPE_STATION) |
2309 BIT(NL80211_IFTYPE_ADHOC);
2310
2311 hw->wiphy->custom_regulatory = true;
2312
2313 /* Firmware does not support this */
2314 hw->wiphy->disable_beacon_hints = true;
2315
2316 /*
2317 * For now, disable PS by default because it affects
2318 * RX performance significantly.
2319 */
2320 hw->wiphy->ps_default = false;
2321
2322 hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX;
2323 /* we create the 802.11 header and a zero-length SSID element */
2324 hw->wiphy->max_scan_ie_len = IWL_MAX_PROBE_REQUEST - 24 - 2;
2325
2326 /* Default value; 4 EDCA QOS priorities */
2327 hw->queues = 4;
2328
2329 hw->max_listen_interval = IWL_CONN_MAX_LISTEN_INTERVAL;
2330
2331 if (priv->bands[IEEE80211_BAND_2GHZ].n_channels)
2332 priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] =
2333 &priv->bands[IEEE80211_BAND_2GHZ];
2334 if (priv->bands[IEEE80211_BAND_5GHZ].n_channels)
2335 priv->hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
2336 &priv->bands[IEEE80211_BAND_5GHZ];
2337
2338 ret = ieee80211_register_hw(priv->hw);
2339 if (ret) {
2340 IWL_ERR(priv, "Failed to register hw (error %d)\n", ret);
2341 return ret;
2342 }
2343 priv->mac80211_registered = 1;
2344
2345 return 0;
2346}
2347
2348
2287static int iwl_mac_start(struct ieee80211_hw *hw) 2349static int iwl_mac_start(struct ieee80211_hw *hw)
2288{ 2350{
2289 struct iwl_priv *priv = hw->priv; 2351 struct iwl_priv *priv = hw->priv;
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 3e6ce5ce36aa..7ce8663fdb7b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1429,64 +1429,6 @@ void iwl_configure_filter(struct ieee80211_hw *hw,
1429} 1429}
1430EXPORT_SYMBOL(iwl_configure_filter); 1430EXPORT_SYMBOL(iwl_configure_filter);
1431 1431
1432int iwl_setup_mac(struct iwl_priv *priv)
1433{
1434 int ret;
1435 struct ieee80211_hw *hw = priv->hw;
1436 hw->rate_control_algorithm = "iwl-agn-rs";
1437
1438 /* Tell mac80211 our characteristics */
1439 hw->flags = IEEE80211_HW_SIGNAL_DBM |
1440 IEEE80211_HW_NOISE_DBM |
1441 IEEE80211_HW_AMPDU_AGGREGATION |
1442 IEEE80211_HW_SPECTRUM_MGMT;
1443
1444 if (!priv->cfg->broken_powersave)
1445 hw->flags |= IEEE80211_HW_SUPPORTS_PS |
1446 IEEE80211_HW_SUPPORTS_DYNAMIC_PS;
1447
1448 hw->wiphy->interface_modes =
1449 BIT(NL80211_IFTYPE_STATION) |
1450 BIT(NL80211_IFTYPE_ADHOC);
1451
1452 hw->wiphy->custom_regulatory = true;
1453
1454 /* Firmware does not support this */
1455 hw->wiphy->disable_beacon_hints = true;
1456
1457 /*
1458 * For now, disable PS by default because it affects
1459 * RX performance significantly.
1460 */
1461 hw->wiphy->ps_default = false;
1462
1463 hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX;
1464 /* we create the 802.11 header and a zero-length SSID element */
1465 hw->wiphy->max_scan_ie_len = IWL_MAX_PROBE_REQUEST - 24 - 2;
1466
1467 /* Default value; 4 EDCA QOS priorities */
1468 hw->queues = 4;
1469
1470 hw->max_listen_interval = IWL_CONN_MAX_LISTEN_INTERVAL;
1471
1472 if (priv->bands[IEEE80211_BAND_2GHZ].n_channels)
1473 priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] =
1474 &priv->bands[IEEE80211_BAND_2GHZ];
1475 if (priv->bands[IEEE80211_BAND_5GHZ].n_channels)
1476 priv->hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
1477 &priv->bands[IEEE80211_BAND_5GHZ];
1478
1479 ret = ieee80211_register_hw(priv->hw);
1480 if (ret) {
1481 IWL_ERR(priv, "Failed to register hw (error %d)\n", ret);
1482 return ret;
1483 }
1484 priv->mac80211_registered = 1;
1485
1486 return 0;
1487}
1488EXPORT_SYMBOL(iwl_setup_mac);
1489
1490int iwl_set_hw_params(struct iwl_priv *priv) 1432int iwl_set_hw_params(struct iwl_priv *priv)
1491{ 1433{
1492 priv->hw_params.max_rxq_size = RX_QUEUE_SIZE; 1434 priv->hw_params.max_rxq_size = RX_QUEUE_SIZE;
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index b877f8893fdf..a2a580df3d99 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -305,7 +305,6 @@ void iwl_configure_filter(struct ieee80211_hw *hw,
305 unsigned int changed_flags, 305 unsigned int changed_flags,
306 unsigned int *total_flags, u64 multicast); 306 unsigned int *total_flags, u64 multicast);
307int iwl_hw_nic_init(struct iwl_priv *priv); 307int iwl_hw_nic_init(struct iwl_priv *priv);
308int iwl_setup_mac(struct iwl_priv *priv);
309int iwl_set_hw_params(struct iwl_priv *priv); 308int iwl_set_hw_params(struct iwl_priv *priv);
310int iwl_init_drv(struct iwl_priv *priv); 309int iwl_init_drv(struct iwl_priv *priv);
311void iwl_uninit_drv(struct iwl_priv *priv); 310void iwl_uninit_drv(struct iwl_priv *priv);