diff options
author | Kalle Valo <kvalo@qca.qualcomm.com> | 2012-07-19 09:00:48 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2012-10-24 04:49:35 -0400 |
commit | 11f0bfcf73f4a90c8c0e0b244a272379b376adb1 (patch) | |
tree | 0a7ff3e09d0059df8ceda77cea5c059964ebe40e | |
parent | c8c72b74e289a3439e9c2438ca675c5a746bf929 (diff) |
ath6kl: refactor wmi scan command
ATH6KL_FW_CAPABILITY_STA_P2PDEV_DUPLEX was checked in cfg80211.c which is
a bit awkward when adding more callsites to the scan functions. Refactor
the code to wmi.c so that it's transparent to the callers.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/cfg80211.c | 31 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/wmi.c | 25 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/wmi.h | 5 |
3 files changed, 28 insertions, 33 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c index 0194617ff30e..4f538f0027f2 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c | |||
@@ -1031,30 +1031,15 @@ static int ath6kl_cfg80211_scan(struct wiphy *wiphy, | |||
1031 | 1031 | ||
1032 | vif->scan_req = request; | 1032 | vif->scan_req = request; |
1033 | 1033 | ||
1034 | if (test_bit(ATH6KL_FW_CAPABILITY_STA_P2PDEV_DUPLEX, | 1034 | ret = ath6kl_wmi_beginscan_cmd(ar->wmi, vif->fw_vif_idx, |
1035 | ar->fw_capabilities)) { | 1035 | WMI_LONG_SCAN, force_fg_scan, |
1036 | /* | 1036 | false, 0, |
1037 | * If capable of doing P2P mgmt operations using | 1037 | ATH6KL_FG_SCAN_INTERVAL, |
1038 | * station interface, send additional information like | 1038 | n_channels, channels, |
1039 | * supported rates to advertise and xmit rates for | 1039 | request->no_cck, |
1040 | * probe requests | 1040 | request->rates); |
1041 | */ | ||
1042 | ret = ath6kl_wmi_beginscan_cmd(ar->wmi, vif->fw_vif_idx, | ||
1043 | WMI_LONG_SCAN, force_fg_scan, | ||
1044 | false, 0, | ||
1045 | ATH6KL_FG_SCAN_INTERVAL, | ||
1046 | n_channels, channels, | ||
1047 | request->no_cck, | ||
1048 | request->rates); | ||
1049 | } else { | ||
1050 | ret = ath6kl_wmi_startscan_cmd(ar->wmi, vif->fw_vif_idx, | ||
1051 | WMI_LONG_SCAN, force_fg_scan, | ||
1052 | false, 0, | ||
1053 | ATH6KL_FG_SCAN_INTERVAL, | ||
1054 | n_channels, channels); | ||
1055 | } | ||
1056 | if (ret) { | 1041 | if (ret) { |
1057 | ath6kl_err("wmi_startscan_cmd failed\n"); | 1042 | ath6kl_err("failed to start scan: %d\n", ret); |
1058 | vif->scan_req = NULL; | 1043 | vif->scan_req = NULL; |
1059 | } | 1044 | } |
1060 | 1045 | ||
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c index a9d7e000017a..05cc871f8244 100644 --- a/drivers/net/wireless/ath/ath6kl/wmi.c +++ b/drivers/net/wireless/ath/ath6kl/wmi.c | |||
@@ -1899,11 +1899,12 @@ int ath6kl_wmi_disconnect_cmd(struct wmi *wmi, u8 if_idx) | |||
1899 | * ath6kl_wmi_begin_scan_cmd instead. The new function supports P2P | 1899 | * ath6kl_wmi_begin_scan_cmd instead. The new function supports P2P |
1900 | * mgmt operations using station interface. | 1900 | * mgmt operations using station interface. |
1901 | */ | 1901 | */ |
1902 | int ath6kl_wmi_startscan_cmd(struct wmi *wmi, u8 if_idx, | 1902 | static int ath6kl_wmi_startscan_cmd(struct wmi *wmi, u8 if_idx, |
1903 | enum wmi_scan_type scan_type, | 1903 | enum wmi_scan_type scan_type, |
1904 | u32 force_fgscan, u32 is_legacy, | 1904 | u32 force_fgscan, u32 is_legacy, |
1905 | u32 home_dwell_time, u32 force_scan_interval, | 1905 | u32 home_dwell_time, |
1906 | s8 num_chan, u16 *ch_list) | 1906 | u32 force_scan_interval, |
1907 | s8 num_chan, u16 *ch_list) | ||
1907 | { | 1908 | { |
1908 | struct sk_buff *skb; | 1909 | struct sk_buff *skb; |
1909 | struct wmi_start_scan_cmd *sc; | 1910 | struct wmi_start_scan_cmd *sc; |
@@ -1942,6 +1943,11 @@ int ath6kl_wmi_startscan_cmd(struct wmi *wmi, u8 if_idx, | |||
1942 | return ret; | 1943 | return ret; |
1943 | } | 1944 | } |
1944 | 1945 | ||
1946 | /* | ||
1947 | * beginscan supports (compared to old startscan) P2P mgmt operations using | ||
1948 | * station interface, send additional information like supported rates to | ||
1949 | * advertise and xmit rates for probe requests | ||
1950 | */ | ||
1945 | int ath6kl_wmi_beginscan_cmd(struct wmi *wmi, u8 if_idx, | 1951 | int ath6kl_wmi_beginscan_cmd(struct wmi *wmi, u8 if_idx, |
1946 | enum wmi_scan_type scan_type, | 1952 | enum wmi_scan_type scan_type, |
1947 | u32 force_fgscan, u32 is_legacy, | 1953 | u32 force_fgscan, u32 is_legacy, |
@@ -1957,6 +1963,15 @@ int ath6kl_wmi_beginscan_cmd(struct wmi *wmi, u8 if_idx, | |||
1957 | int num_rates; | 1963 | int num_rates; |
1958 | u32 ratemask; | 1964 | u32 ratemask; |
1959 | 1965 | ||
1966 | if (!test_bit(ATH6KL_FW_CAPABILITY_STA_P2PDEV_DUPLEX, | ||
1967 | ar->fw_capabilities)) { | ||
1968 | return ath6kl_wmi_startscan_cmd(wmi, if_idx, | ||
1969 | scan_type, force_fgscan, | ||
1970 | is_legacy, home_dwell_time, | ||
1971 | force_scan_interval, | ||
1972 | num_chan, ch_list); | ||
1973 | } | ||
1974 | |||
1960 | size = sizeof(struct wmi_begin_scan_cmd); | 1975 | size = sizeof(struct wmi_begin_scan_cmd); |
1961 | 1976 | ||
1962 | if ((scan_type != WMI_LONG_SCAN) && (scan_type != WMI_SHORT_SCAN)) | 1977 | if ((scan_type != WMI_LONG_SCAN) && (scan_type != WMI_SHORT_SCAN)) |
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.h b/drivers/net/wireless/ath/ath6kl/wmi.h index 8e8846f1b1a5..5166a8e64927 100644 --- a/drivers/net/wireless/ath/ath6kl/wmi.h +++ b/drivers/net/wireless/ath/ath6kl/wmi.h | |||
@@ -2547,11 +2547,6 @@ int ath6kl_wmi_connect_cmd(struct wmi *wmi, u8 if_idx, | |||
2547 | int ath6kl_wmi_reconnect_cmd(struct wmi *wmi, u8 if_idx, u8 *bssid, | 2547 | int ath6kl_wmi_reconnect_cmd(struct wmi *wmi, u8 if_idx, u8 *bssid, |
2548 | u16 channel); | 2548 | u16 channel); |
2549 | int ath6kl_wmi_disconnect_cmd(struct wmi *wmi, u8 if_idx); | 2549 | int ath6kl_wmi_disconnect_cmd(struct wmi *wmi, u8 if_idx); |
2550 | int ath6kl_wmi_startscan_cmd(struct wmi *wmi, u8 if_idx, | ||
2551 | enum wmi_scan_type scan_type, | ||
2552 | u32 force_fgscan, u32 is_legacy, | ||
2553 | u32 home_dwell_time, u32 force_scan_interval, | ||
2554 | s8 num_chan, u16 *ch_list); | ||
2555 | 2550 | ||
2556 | int ath6kl_wmi_beginscan_cmd(struct wmi *wmi, u8 if_idx, | 2551 | int ath6kl_wmi_beginscan_cmd(struct wmi *wmi, u8 if_idx, |
2557 | enum wmi_scan_type scan_type, | 2552 | enum wmi_scan_type scan_type, |