• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/net/wireless/iwmc3200wifi/

Lines Matching defs:iwm

33 #include "iwm.h"
167 struct iwm_priv *iwm = ndev_to_iwm(ndev);
168 struct iwm_key *key = &iwm->keys[key_index];
171 IWM_DBG_WEXT(iwm, DBG, "Adding key for %pM\n", mac_addr);
176 IWM_ERR(iwm, "Invalid key_params\n");
180 return iwm_set_key(iwm, 0, key);
188 struct iwm_priv *iwm = ndev_to_iwm(ndev);
189 struct iwm_key *key = &iwm->keys[key_index];
192 IWM_DBG_WEXT(iwm, DBG, "Getting key %d\n", key_index);
211 struct iwm_priv *iwm = ndev_to_iwm(ndev);
212 struct iwm_key *key = &iwm->keys[key_index];
214 if (!iwm->keys[key_index].key_len) {
215 IWM_DBG_WEXT(iwm, DBG, "Key %d not used\n", key_index);
219 if (key_index == iwm->default_key)
220 iwm->default_key = -1;
222 return iwm_set_key(iwm, 1, key);
229 struct iwm_priv *iwm = ndev_to_iwm(ndev);
231 IWM_DBG_WEXT(iwm, DBG, "Default key index is: %d\n", key_index);
233 if (!iwm->keys[key_index].key_len) {
234 IWM_ERR(iwm, "Key %d not used\n", key_index);
238 iwm->default_key = key_index;
240 return iwm_set_tx_key(iwm, key_index);
247 struct iwm_priv *iwm = ndev_to_iwm(ndev);
249 if (memcmp(mac, iwm->bssid, ETH_ALEN))
253 sinfo->txrate.legacy = iwm->rate * 10;
255 if (test_bit(IWM_STATUS_ASSOCIATED, &iwm->status)) {
257 sinfo->signal = iwm->wstats.qual.level;
264 int iwm_cfg80211_inform_bss(struct iwm_priv *iwm)
266 struct wiphy *wiphy = iwm_to_wiphy(iwm);
275 list_for_each_entry(bss, &iwm->bss_list, node) {
284 IWM_ERR(iwm, "Invalid band: %d\n", umac_bss->band);
307 struct iwm_priv *iwm;
311 iwm = ndev_to_iwm(ndev);
312 old_mode = iwm->conf.mode;
316 iwm->conf.mode = UMAC_MODE_BSS;
319 iwm->conf.mode = UMAC_MODE_IBSS;
327 if ((old_mode == iwm->conf.mode) || !iwm->umac_profile)
330 iwm->umac_profile->mode = cpu_to_le32(iwm->conf.mode);
332 if (iwm->umac_profile_active)
333 iwm_invalidate_mlme_profile(iwm);
341 struct iwm_priv *iwm = ndev_to_iwm(ndev);
344 if (!test_bit(IWM_STATUS_READY, &iwm->status)) {
345 IWM_ERR(iwm, "Scan while device is not ready\n");
349 if (test_bit(IWM_STATUS_SCANNING, &iwm->status)) {
350 IWM_ERR(iwm, "Scanning already\n");
354 if (test_bit(IWM_STATUS_SCAN_ABORTING, &iwm->status)) {
355 IWM_ERR(iwm, "Scanning being aborted\n");
359 set_bit(IWM_STATUS_SCANNING, &iwm->status);
361 ret = iwm_scan_ssids(iwm, request->ssids, request->n_ssids);
363 clear_bit(IWM_STATUS_SCANNING, &iwm->status);
367 iwm->scan_request = request;
373 struct iwm_priv *iwm = wiphy_to_iwm(wiphy);
376 (iwm->conf.rts_threshold != wiphy->rts_threshold)) {
379 iwm->conf.rts_threshold = wiphy->rts_threshold;
381 ret = iwm_umac_set_config_fix(iwm, UMAC_PARAM_TBL_CFG_FIX,
383 iwm->conf.rts_threshold);
389 (iwm->conf.frag_threshold != wiphy->frag_threshold)) {
392 iwm->conf.frag_threshold = wiphy->frag_threshold;
394 ret = iwm_umac_set_config_fix(iwm, UMAC_PARAM_TBL_FA_CFG_FIX,
396 iwm->conf.frag_threshold);
407 struct iwm_priv *iwm = wiphy_to_iwm(wiphy);
410 if (!test_bit(IWM_STATUS_READY, &iwm->status))
418 iwm->channel = ieee80211_frequency_to_channel(chan->center_freq);
419 iwm->umac_profile->ibss.band = chan->band;
420 iwm->umac_profile->ibss.channel = iwm->channel;
421 iwm->umac_profile->ssid.ssid_len = params->ssid_len;
422 memcpy(iwm->umac_profile->ssid.ssid, params->ssid, params->ssid_len);
424 return iwm_send_mlme_profile(iwm);
429 struct iwm_priv *iwm = wiphy_to_iwm(wiphy);
431 if (iwm->umac_profile_active)
432 return iwm_invalidate_mlme_profile(iwm);
437 static int iwm_set_auth_type(struct iwm_priv *iwm,
440 u8 *auth_type = &iwm->umac_profile->sec.auth_type;
445 IWM_DBG_WEXT(iwm, DBG, "OPEN auth\n");
449 if (iwm->umac_profile->sec.flags &
451 IWM_DBG_WEXT(iwm, DBG, "WPA auth alg\n");
454 IWM_DBG_WEXT(iwm, DBG, "WEP shared key auth alg\n");
460 IWM_ERR(iwm, "Unsupported auth alg: 0x%x\n", sme_auth_type);
467 static int iwm_set_wpa_version(struct iwm_priv *iwm, u32 wpa_version)
469 IWM_DBG_WEXT(iwm, DBG, "wpa_version: %d\n", wpa_version);
472 iwm->umac_profile->sec.flags = UMAC_SEC_FLG_LEGACY_PROFILE;
477 iwm->umac_profile->sec.flags = UMAC_SEC_FLG_WPA_ON_MSK;
480 iwm->umac_profile->sec.flags = UMAC_SEC_FLG_RSNA_ON_MSK;
485 static int iwm_set_cipher(struct iwm_priv *iwm, u32 cipher, bool ucast)
487 u8 *profile_cipher = ucast ? &iwm->umac_profile->sec.ucast_cipher :
488 &iwm->umac_profile->sec.mcast_cipher;
495 IWM_DBG_WEXT(iwm, DBG, "%ccast cipher is 0x%x\n", ucast ? 'u' : 'm',
515 IWM_ERR(iwm, "Unsupported cipher: 0x%x\n", cipher);
522 static int iwm_set_key_mgt(struct iwm_priv *iwm, u32 key_mgt)
524 u8 *auth_type = &iwm->umac_profile->sec.auth_type;
526 IWM_DBG_WEXT(iwm, DBG, "key_mgt: 0x%x\n", key_mgt);
531 if (iwm->umac_profile->sec.flags &
537 IWM_ERR(iwm, "Invalid key mgt: 0x%x\n", key_mgt);
548 struct iwm_priv *iwm = wiphy_to_iwm(wiphy);
553 if (!test_bit(IWM_STATUS_READY, &iwm->status))
559 if (iwm->umac_profile_active) {
560 ret = iwm_invalidate_mlme_profile(iwm);
562 IWM_ERR(iwm, "Couldn't invalidate profile\n");
568 iwm->channel =
571 iwm->umac_profile->ssid.ssid_len = sme->ssid_len;
572 memcpy(iwm->umac_profile->ssid.ssid, sme->ssid, sme->ssid_len);
575 IWM_DBG_WEXT(iwm, DBG, "BSSID: %pM\n", sme->bssid);
576 memcpy(&iwm->umac_profile->bssid[0], sme->bssid, ETH_ALEN);
577 iwm->umac_profile->bss_num = 1;
579 memset(&iwm->umac_profile->bssid[0], 0, ETH_ALEN);
580 iwm->umac_profile->bss_num = 0;
583 ret = iwm_set_wpa_version(iwm, sme->crypto.wpa_versions);
587 ret = iwm_set_auth_type(iwm, sme->auth_type);
592 ret = iwm_set_cipher(iwm, sme->crypto.ciphers_pairwise[0],
598 ret = iwm_set_cipher(iwm, sme->crypto.cipher_group, false);
603 ret = iwm_set_key_mgt(iwm, sme->crypto.akm_suites[0]);
621 ret = iwm_key_init(&iwm->keys[sme->key_idx], sme->key_idx,
625 IWM_ERR(iwm, "Invalid key_params\n");
629 iwm->default_key = sme->key_idx;
633 if ((iwm->umac_profile->sec.flags &
635 iwm->umac_profile->sec.auth_type == UMAC_AUTH_TYPE_OPEN) {
636 iwm->umac_profile->sec.flags = UMAC_SEC_FLG_WSC_ON_MSK;
639 ret = iwm_send_mlme_profile(iwm);
641 if (iwm->umac_profile->sec.auth_type != UMAC_AUTH_TYPE_LEGACY_PSK ||
652 ret = iwm_set_key(iwm, 0, &iwm->keys[sme->key_idx]);
656 return iwm_set_tx_key(iwm, iwm->default_key);
662 struct iwm_priv *iwm = wiphy_to_iwm(wiphy);
664 IWM_DBG_WEXT(iwm, DBG, "Active: %d\n", iwm->umac_profile_active);
666 if (iwm->umac_profile_active)
667 iwm_invalidate_mlme_profile(iwm);
675 struct iwm_priv *iwm = wiphy_to_iwm(wiphy);
685 if (!test_bit(IWM_STATUS_READY, &iwm->status))
688 ret = iwm_umac_set_config_fix(iwm, UMAC_PARAM_TBL_CFG_FIX,
694 return iwm_tx_power_trigger(iwm);
696 IWM_ERR(iwm, "Unsupported power type: %d\n", type);
705 struct iwm_priv *iwm = wiphy_to_iwm(wiphy);
707 *dbm = iwm->txpower >> 1;
716 struct iwm_priv *iwm = wiphy_to_iwm(wiphy);
724 if (power_index == iwm->conf.power_index)
727 iwm->conf.power_index = power_index;
729 return iwm_umac_set_config_fix(iwm, UMAC_PARAM_TBL_CFG_FIX,
730 CFG_POWER_INDEX, iwm->conf.power_index);
737 struct iwm_priv *iwm = wiphy_to_iwm(wiphy);
739 return iwm_send_pmkid_update(iwm, pmksa, IWM_CMD_PMKID_ADD);
746 struct iwm_priv *iwm = wiphy_to_iwm(wiphy);
748 return iwm_send_pmkid_update(iwm, pmksa, IWM_CMD_PMKID_DEL);
754 struct iwm_priv *iwm = wiphy_to_iwm(wiphy);
759 return iwm_send_pmkid_update(iwm, &pmksa, IWM_CMD_PMKID_FLUSH);
854 void iwm_wdev_free(struct iwm_priv *iwm)
856 struct wireless_dev *wdev = iwm_to_wdev(iwm);