cfg80211.c (8f46fccd6cd0d7ba70ba1636e59e98ca17dd2239) | cfg80211.c (ce0dc0cfeac9fde9964fa4b07aecd7cc604060e0) |
---|---|
1/* 2 * Copyright (c) 2004-2011 Atheros Communications Inc. 3 * Copyright (c) 2011-2012 Qualcomm Atheros, Inc. 4 * 5 * Permission to use, copy, modify, and/or distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * --- 409 unchanged lines hidden (view full) --- 418 419static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, 420 struct cfg80211_connect_params *sme) 421{ 422 struct ath6kl *ar = ath6kl_priv(dev); 423 struct ath6kl_vif *vif = netdev_priv(dev); 424 int status; 425 u8 nw_subtype = (ar->p2p) ? SUBTYPE_P2PDEV : SUBTYPE_NONE; | 1/* 2 * Copyright (c) 2004-2011 Atheros Communications Inc. 3 * Copyright (c) 2011-2012 Qualcomm Atheros, Inc. 4 * 5 * Permission to use, copy, modify, and/or distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * --- 409 unchanged lines hidden (view full) --- 418 419static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, 420 struct cfg80211_connect_params *sme) 421{ 422 struct ath6kl *ar = ath6kl_priv(dev); 423 struct ath6kl_vif *vif = netdev_priv(dev); 424 int status; 425 u8 nw_subtype = (ar->p2p) ? SUBTYPE_P2PDEV : SUBTYPE_NONE; |
426 u16 interval; |
|
426 427 ath6kl_cfg80211_sscan_disable(vif); 428 429 vif->sme_state = SME_CONNECTING; 430 431 if (!ath6kl_cfg80211_ready(vif)) 432 return -EIO; 433 --- 138 unchanged lines hidden (view full) --- 572 " PW crypto %d PW crypto len %d GRP crypto %d" 573 " GRP crypto len %d channel hint %u\n", 574 __func__, 575 vif->auth_mode, vif->dot11_auth_mode, vif->prwise_crypto, 576 vif->prwise_crypto_len, vif->grp_crypto, 577 vif->grp_crypto_len, vif->ch_hint); 578 579 vif->reconnect_flag = 0; | 427 428 ath6kl_cfg80211_sscan_disable(vif); 429 430 vif->sme_state = SME_CONNECTING; 431 432 if (!ath6kl_cfg80211_ready(vif)) 433 return -EIO; 434 --- 138 unchanged lines hidden (view full) --- 573 " PW crypto %d PW crypto len %d GRP crypto %d" 574 " GRP crypto len %d channel hint %u\n", 575 __func__, 576 vif->auth_mode, vif->dot11_auth_mode, vif->prwise_crypto, 577 vif->prwise_crypto_len, vif->grp_crypto, 578 vif->grp_crypto_len, vif->ch_hint); 579 580 vif->reconnect_flag = 0; |
581 582 if (vif->nw_type == INFRA_NETWORK) { 583 interval = max(vif->listen_intvl_t, 584 (u16) ATH6KL_MAX_WOW_LISTEN_INTL); 585 status = ath6kl_wmi_listeninterval_cmd(ar->wmi, vif->fw_vif_idx, 586 interval, 587 0); 588 if (status) { 589 ath6kl_err("couldn't set listen intervel\n"); 590 up(&ar->sem); 591 return status; 592 } 593 } 594 |
|
580 status = ath6kl_wmi_connect_cmd(ar->wmi, vif->fw_vif_idx, vif->nw_type, 581 vif->dot11_auth_mode, vif->auth_mode, 582 vif->prwise_crypto, 583 vif->prwise_crypto_len, 584 vif->grp_crypto, vif->grp_crypto_len, 585 vif->ssid_len, vif->ssid, 586 vif->req_bssid, vif->ch_hint, 587 ar->connect_ctrl_flags, nw_subtype); --- 1318 unchanged lines hidden (view full) --- 1906 1907static int ath6kl_wow_suspend(struct ath6kl *ar, struct cfg80211_wowlan *wow) 1908{ 1909 struct in_device *in_dev; 1910 struct in_ifaddr *ifa; 1911 struct ath6kl_vif *vif; 1912 int ret, left; 1913 u32 filter = 0; | 595 status = ath6kl_wmi_connect_cmd(ar->wmi, vif->fw_vif_idx, vif->nw_type, 596 vif->dot11_auth_mode, vif->auth_mode, 597 vif->prwise_crypto, 598 vif->prwise_crypto_len, 599 vif->grp_crypto, vif->grp_crypto_len, 600 vif->ssid_len, vif->ssid, 601 vif->req_bssid, vif->ch_hint, 602 ar->connect_ctrl_flags, nw_subtype); --- 1318 unchanged lines hidden (view full) --- 1921 1922static int ath6kl_wow_suspend(struct ath6kl *ar, struct cfg80211_wowlan *wow) 1923{ 1924 struct in_device *in_dev; 1925 struct in_ifaddr *ifa; 1926 struct ath6kl_vif *vif; 1927 int ret, left; 1928 u32 filter = 0; |
1914 u16 i; | 1929 u16 i, bmiss_time; |
1915 u8 index = 0; 1916 __be32 ips[MAX_IP_ADDRS]; 1917 1918 vif = ath6kl_vif_first(ar); 1919 if (!vif) 1920 return -EIO; 1921 1922 if (!ath6kl_cfg80211_ready(vif)) --- 22 unchanged lines hidden (view full) --- 1945 else 1946 ret = ath6kl_wow_sta(ar, vif); 1947 1948 if (ret) 1949 return ret; 1950 1951 netif_stop_queue(vif->ndev); 1952 | 1930 u8 index = 0; 1931 __be32 ips[MAX_IP_ADDRS]; 1932 1933 vif = ath6kl_vif_first(ar); 1934 if (!vif) 1935 return -EIO; 1936 1937 if (!ath6kl_cfg80211_ready(vif)) --- 22 unchanged lines hidden (view full) --- 1960 else 1961 ret = ath6kl_wow_sta(ar, vif); 1962 1963 if (ret) 1964 return ret; 1965 1966 netif_stop_queue(vif->ndev); 1967 |
1968 if (vif->nw_type != AP_NETWORK) { 1969 ret = ath6kl_wmi_listeninterval_cmd(ar->wmi, vif->fw_vif_idx, 1970 ATH6KL_MAX_WOW_LISTEN_INTL, 1971 0); 1972 if (ret) 1973 return ret; 1974 1975 /* Set listen interval x 15 times as bmiss time */ 1976 bmiss_time = ATH6KL_MAX_WOW_LISTEN_INTL * 15; 1977 if (bmiss_time > ATH6KL_MAX_BMISS_TIME) 1978 bmiss_time = ATH6KL_MAX_BMISS_TIME; 1979 1980 ret = ath6kl_wmi_bmisstime_cmd(ar->wmi, vif->fw_vif_idx, 1981 bmiss_time, 0); 1982 if (ret) 1983 return ret; 1984 1985 ret = ath6kl_wmi_scanparams_cmd(ar->wmi, vif->fw_vif_idx, 1986 0xFFFF, 0, 0xFFFF, 0, 0, 0, 1987 0, 0, 0, 0); 1988 if (ret) 1989 return ret; 1990 } 1991 |
|
1953 ar->state = ATH6KL_STATE_SUSPENDING; 1954 1955 /* Setup own IP addr for ARP agent. */ 1956 in_dev = __in_dev_get_rtnl(vif->ndev); 1957 if (!in_dev) 1958 goto skip_arp; 1959 1960 ifa = in_dev->ifa_list; --- 75 unchanged lines hidden (view full) --- 2036 ATH6KL_HOST_MODE_AWAKE); 2037 if (ret) { 2038 ath6kl_warn("Failed to configure host sleep mode for " 2039 "wow resume: %d\n", ret); 2040 ar->state = ATH6KL_STATE_WOW; 2041 return ret; 2042 } 2043 | 1992 ar->state = ATH6KL_STATE_SUSPENDING; 1993 1994 /* Setup own IP addr for ARP agent. */ 1995 in_dev = __in_dev_get_rtnl(vif->ndev); 1996 if (!in_dev) 1997 goto skip_arp; 1998 1999 ifa = in_dev->ifa_list; --- 75 unchanged lines hidden (view full) --- 2075 ATH6KL_HOST_MODE_AWAKE); 2076 if (ret) { 2077 ath6kl_warn("Failed to configure host sleep mode for " 2078 "wow resume: %d\n", ret); 2079 ar->state = ATH6KL_STATE_WOW; 2080 return ret; 2081 } 2082 |
2083 if (vif->nw_type != AP_NETWORK) { 2084 ret = ath6kl_wmi_scanparams_cmd(ar->wmi, vif->fw_vif_idx, 2085 0, 0, 0, 0, 0, 0, 3, 0, 0, 0); 2086 if (ret) 2087 return ret; 2088 2089 ret = ath6kl_wmi_listeninterval_cmd(ar->wmi, vif->fw_vif_idx, 2090 vif->listen_intvl_t, 0); 2091 if (ret) 2092 return ret; 2093 2094 ret = ath6kl_wmi_bmisstime_cmd(ar->wmi, vif->fw_vif_idx, 2095 vif->bmiss_time_t, 0); 2096 if (ret) 2097 return ret; 2098 } 2099 |
|
2044 ar->state = ATH6KL_STATE_ON; 2045 2046 netif_wake_queue(vif->ndev); 2047 2048 return 0; 2049} 2050 2051int ath6kl_cfg80211_suspend(struct ath6kl *ar, --- 977 unchanged lines hidden (view full) --- 3029 vif->ar = ar; 3030 vif->ndev = ndev; 3031 SET_NETDEV_DEV(ndev, wiphy_dev(vif->wdev.wiphy)); 3032 vif->wdev.netdev = ndev; 3033 vif->wdev.iftype = type; 3034 vif->fw_vif_idx = fw_vif_idx; 3035 vif->nw_type = vif->next_mode = nw_type; 3036 vif->listen_intvl_t = ATH6KL_DEFAULT_LISTEN_INTVAL; | 2100 ar->state = ATH6KL_STATE_ON; 2101 2102 netif_wake_queue(vif->ndev); 2103 2104 return 0; 2105} 2106 2107int ath6kl_cfg80211_suspend(struct ath6kl *ar, --- 977 unchanged lines hidden (view full) --- 3085 vif->ar = ar; 3086 vif->ndev = ndev; 3087 SET_NETDEV_DEV(ndev, wiphy_dev(vif->wdev.wiphy)); 3088 vif->wdev.netdev = ndev; 3089 vif->wdev.iftype = type; 3090 vif->fw_vif_idx = fw_vif_idx; 3091 vif->nw_type = vif->next_mode = nw_type; 3092 vif->listen_intvl_t = ATH6KL_DEFAULT_LISTEN_INTVAL; |
3093 vif->bmiss_time_t = ATH6KL_DEFAULT_BMISS_TIME; |
|
3037 3038 memcpy(ndev->dev_addr, ar->mac_addr, ETH_ALEN); 3039 if (fw_vif_idx != 0) 3040 ndev->dev_addr[0] = (ndev->dev_addr[0] ^ (1 << fw_vif_idx)) | 3041 0x2; 3042 3043 init_netdev(ndev); 3044 --- 133 unchanged lines hidden --- | 3094 3095 memcpy(ndev->dev_addr, ar->mac_addr, ETH_ALEN); 3096 if (fw_vif_idx != 0) 3097 ndev->dev_addr[0] = (ndev->dev_addr[0] ^ (1 << fw_vif_idx)) | 3098 0x2; 3099 3100 init_netdev(ndev); 3101 --- 133 unchanged lines hidden --- |