aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKalle Valo <kvalo@qca.qualcomm.com>2012-07-19 09:00:40 -0400
committerKalle Valo <kvalo@qca.qualcomm.com>2012-10-24 04:49:34 -0400
commitc8c72b74e289a3439e9c2438ca675c5a746bf929 (patch)
tree98ce2c54187a55fec945846d32d98640c72df6a0
parent279b2862ee6ba9ee950c02044142f8ea137c302e (diff)
ath6kl: move ath6kl_wmi_startscan_cmd()
To make it easier to refactor the scan commands move ath6kl_wmi_startscan_cmd() before the beginscan function. No functional changes. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
-rw-r--r--drivers/net/wireless/ath/ath6kl/wmi.c88
1 files changed, 44 insertions, 44 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
index 4762fa570630..a9d7e000017a 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.c
+++ b/drivers/net/wireless/ath/ath6kl/wmi.c
@@ -1895,22 +1895,22 @@ int ath6kl_wmi_disconnect_cmd(struct wmi *wmi, u8 if_idx)
1895 return ret; 1895 return ret;
1896} 1896}
1897 1897
1898int ath6kl_wmi_beginscan_cmd(struct wmi *wmi, u8 if_idx, 1898/* ath6kl_wmi_start_scan_cmd is to be deprecated. Use
1899 * ath6kl_wmi_begin_scan_cmd instead. The new function supports P2P
1900 * mgmt operations using station interface.
1901 */
1902int ath6kl_wmi_startscan_cmd(struct wmi *wmi, u8 if_idx,
1899 enum wmi_scan_type scan_type, 1903 enum wmi_scan_type scan_type,
1900 u32 force_fgscan, u32 is_legacy, 1904 u32 force_fgscan, u32 is_legacy,
1901 u32 home_dwell_time, u32 force_scan_interval, 1905 u32 home_dwell_time, u32 force_scan_interval,
1902 s8 num_chan, u16 *ch_list, u32 no_cck, u32 *rates) 1906 s8 num_chan, u16 *ch_list)
1903{ 1907{
1904 struct ieee80211_supported_band *sband;
1905 struct sk_buff *skb; 1908 struct sk_buff *skb;
1906 struct wmi_begin_scan_cmd *sc; 1909 struct wmi_start_scan_cmd *sc;
1907 s8 size, *supp_rates; 1910 s8 size;
1908 int i, band, ret; 1911 int i, ret;
1909 struct ath6kl *ar = wmi->parent_dev;
1910 int num_rates;
1911 u32 ratemask;
1912 1912
1913 size = sizeof(struct wmi_begin_scan_cmd); 1913 size = sizeof(struct wmi_start_scan_cmd);
1914 1914
1915 if ((scan_type != WMI_LONG_SCAN) && (scan_type != WMI_SHORT_SCAN)) 1915 if ((scan_type != WMI_LONG_SCAN) && (scan_type != WMI_SHORT_SCAN))
1916 return -EINVAL; 1916 return -EINVAL;
@@ -1925,59 +1925,39 @@ int ath6kl_wmi_beginscan_cmd(struct wmi *wmi, u8 if_idx,
1925 if (!skb) 1925 if (!skb)
1926 return -ENOMEM; 1926 return -ENOMEM;
1927 1927
1928 sc = (struct wmi_begin_scan_cmd *) skb->data; 1928 sc = (struct wmi_start_scan_cmd *) skb->data;
1929 sc->scan_type = scan_type; 1929 sc->scan_type = scan_type;
1930 sc->force_fg_scan = cpu_to_le32(force_fgscan); 1930 sc->force_fg_scan = cpu_to_le32(force_fgscan);
1931 sc->is_legacy = cpu_to_le32(is_legacy); 1931 sc->is_legacy = cpu_to_le32(is_legacy);
1932 sc->home_dwell_time = cpu_to_le32(home_dwell_time); 1932 sc->home_dwell_time = cpu_to_le32(home_dwell_time);
1933 sc->force_scan_intvl = cpu_to_le32(force_scan_interval); 1933 sc->force_scan_intvl = cpu_to_le32(force_scan_interval);
1934 sc->no_cck = cpu_to_le32(no_cck);
1935 sc->num_ch = num_chan; 1934 sc->num_ch = num_chan;
1936 1935
1937 for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
1938 sband = ar->wiphy->bands[band];
1939
1940 if (!sband)
1941 continue;
1942
1943 ratemask = rates[band];
1944 supp_rates = sc->supp_rates[band].rates;
1945 num_rates = 0;
1946
1947 for (i = 0; i < sband->n_bitrates; i++) {
1948 if ((BIT(i) & ratemask) == 0)
1949 continue; /* skip rate */
1950 supp_rates[num_rates++] =
1951 (u8) (sband->bitrates[i].bitrate / 5);
1952 }
1953 sc->supp_rates[band].nrates = num_rates;
1954 }
1955
1956 for (i = 0; i < num_chan; i++) 1936 for (i = 0; i < num_chan; i++)
1957 sc->ch_list[i] = cpu_to_le16(ch_list[i]); 1937 sc->ch_list[i] = cpu_to_le16(ch_list[i]);
1958 1938
1959 ret = ath6kl_wmi_cmd_send(wmi, if_idx, skb, WMI_BEGIN_SCAN_CMDID, 1939 ret = ath6kl_wmi_cmd_send(wmi, if_idx, skb, WMI_START_SCAN_CMDID,
1960 NO_SYNC_WMIFLAG); 1940 NO_SYNC_WMIFLAG);
1961 1941
1962 return ret; 1942 return ret;
1963} 1943}
1964 1944
1965/* ath6kl_wmi_start_scan_cmd is to be deprecated. Use 1945int ath6kl_wmi_beginscan_cmd(struct wmi *wmi, u8 if_idx,
1966 * ath6kl_wmi_begin_scan_cmd instead. The new function supports P2P
1967 * mgmt operations using station interface.
1968 */
1969int ath6kl_wmi_startscan_cmd(struct wmi *wmi, u8 if_idx,
1970 enum wmi_scan_type scan_type, 1946 enum wmi_scan_type scan_type,
1971 u32 force_fgscan, u32 is_legacy, 1947 u32 force_fgscan, u32 is_legacy,
1972 u32 home_dwell_time, u32 force_scan_interval, 1948 u32 home_dwell_time, u32 force_scan_interval,
1973 s8 num_chan, u16 *ch_list) 1949 s8 num_chan, u16 *ch_list, u32 no_cck, u32 *rates)
1974{ 1950{
1951 struct ieee80211_supported_band *sband;
1975 struct sk_buff *skb; 1952 struct sk_buff *skb;
1976 struct wmi_start_scan_cmd *sc; 1953 struct wmi_begin_scan_cmd *sc;
1977 s8 size; 1954 s8 size, *supp_rates;
1978 int i, ret; 1955 int i, band, ret;
1956 struct ath6kl *ar = wmi->parent_dev;
1957 int num_rates;
1958 u32 ratemask;
1979 1959
1980 size = sizeof(struct wmi_start_scan_cmd); 1960 size = sizeof(struct wmi_begin_scan_cmd);
1981 1961
1982 if ((scan_type != WMI_LONG_SCAN) && (scan_type != WMI_SHORT_SCAN)) 1962 if ((scan_type != WMI_LONG_SCAN) && (scan_type != WMI_SHORT_SCAN))
1983 return -EINVAL; 1963 return -EINVAL;
@@ -1992,18 +1972,38 @@ int ath6kl_wmi_startscan_cmd(struct wmi *wmi, u8 if_idx,
1992 if (!skb) 1972 if (!skb)
1993 return -ENOMEM; 1973 return -ENOMEM;
1994 1974
1995 sc = (struct wmi_start_scan_cmd *) skb->data; 1975 sc = (struct wmi_begin_scan_cmd *) skb->data;
1996 sc->scan_type = scan_type; 1976 sc->scan_type = scan_type;
1997 sc->force_fg_scan = cpu_to_le32(force_fgscan); 1977 sc->force_fg_scan = cpu_to_le32(force_fgscan);
1998 sc->is_legacy = cpu_to_le32(is_legacy); 1978 sc->is_legacy = cpu_to_le32(is_legacy);
1999 sc->home_dwell_time = cpu_to_le32(home_dwell_time); 1979 sc->home_dwell_time = cpu_to_le32(home_dwell_time);
2000 sc->force_scan_intvl = cpu_to_le32(force_scan_interval); 1980 sc->force_scan_intvl = cpu_to_le32(force_scan_interval);
1981 sc->no_cck = cpu_to_le32(no_cck);
2001 sc->num_ch = num_chan; 1982 sc->num_ch = num_chan;
2002 1983
1984 for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
1985 sband = ar->wiphy->bands[band];
1986
1987 if (!sband)
1988 continue;
1989
1990 ratemask = rates[band];
1991 supp_rates = sc->supp_rates[band].rates;
1992 num_rates = 0;
1993
1994 for (i = 0; i < sband->n_bitrates; i++) {
1995 if ((BIT(i) & ratemask) == 0)
1996 continue; /* skip rate */
1997 supp_rates[num_rates++] =
1998 (u8) (sband->bitrates[i].bitrate / 5);
1999 }
2000 sc->supp_rates[band].nrates = num_rates;
2001 }
2002
2003 for (i = 0; i < num_chan; i++) 2003 for (i = 0; i < num_chan; i++)
2004 sc->ch_list[i] = cpu_to_le16(ch_list[i]); 2004 sc->ch_list[i] = cpu_to_le16(ch_list[i]);
2005 2005
2006 ret = ath6kl_wmi_cmd_send(wmi, if_idx, skb, WMI_START_SCAN_CMDID, 2006 ret = ath6kl_wmi_cmd_send(wmi, if_idx, skb, WMI_BEGIN_SCAN_CMDID,
2007 NO_SYNC_WMIFLAG); 2007 NO_SYNC_WMIFLAG);
2008 2008
2009 return ret; 2009 return ret;