Lines Matching refs:cmd
12 static void wl18xx_adjust_channels(struct wl18xx_cmd_scan_params *cmd, in wl18xx_adjust_channels() argument
15 memcpy(cmd->passive, cmd_channels->passive, sizeof(cmd->passive)); in wl18xx_adjust_channels()
16 memcpy(cmd->active, cmd_channels->active, sizeof(cmd->active)); in wl18xx_adjust_channels()
17 cmd->dfs = cmd_channels->dfs; in wl18xx_adjust_channels()
18 cmd->passive_active = cmd_channels->passive_active; in wl18xx_adjust_channels()
20 memcpy(cmd->channels_2, cmd_channels->channels_2, in wl18xx_adjust_channels()
21 sizeof(cmd->channels_2)); in wl18xx_adjust_channels()
22 memcpy(cmd->channels_5, cmd_channels->channels_5, in wl18xx_adjust_channels()
23 sizeof(cmd->channels_5)); in wl18xx_adjust_channels()
30 struct wl18xx_cmd_scan_params *cmd; in wl18xx_scan_send() local
34 cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); in wl18xx_scan_send()
35 if (!cmd) { in wl18xx_scan_send()
42 cmd->role_id = wlvif->dev_role_id; in wl18xx_scan_send()
44 cmd->role_id = wlvif->role_id; in wl18xx_scan_send()
46 if (WARN_ON(cmd->role_id == WL12XX_INVALID_ROLE_ID)) { in wl18xx_scan_send()
51 cmd->scan_type = SCAN_TYPE_SEARCH; in wl18xx_scan_send()
52 cmd->rssi_threshold = -127; in wl18xx_scan_send()
53 cmd->snr_threshold = 0; in wl18xx_scan_send()
55 cmd->bss_type = SCAN_BSS_TYPE_ANY; in wl18xx_scan_send()
57 cmd->ssid_from_list = 0; in wl18xx_scan_send()
58 cmd->filter = 0; in wl18xx_scan_send()
59 cmd->add_broadcast = 0; in wl18xx_scan_send()
61 cmd->urgency = 0; in wl18xx_scan_send()
62 cmd->protect = 0; in wl18xx_scan_send()
64 cmd->n_probe_reqs = wl->conf.scan.num_probe_reqs; in wl18xx_scan_send()
65 cmd->terminate_after = 0; in wl18xx_scan_send()
79 wl18xx_adjust_channels(cmd, cmd_channels); in wl18xx_scan_send()
85 cmd->total_cycles = 1; in wl18xx_scan_send()
88 cmd->rate = WL18XX_SCAN_RATE_6; in wl18xx_scan_send()
90 cmd->tag = WL1271_SCAN_DEFAULT_TAG; in wl18xx_scan_send()
93 cmd->ssid_len = req->ssids[0].ssid_len; in wl18xx_scan_send()
94 memcpy(cmd->ssid, req->ssids[0].ssid, cmd->ssid_len); in wl18xx_scan_send()
98 if (cmd->active[0]) { in wl18xx_scan_send()
101 cmd->role_id, band, in wl18xx_scan_send()
115 if (cmd->active[1] || cmd->dfs) { in wl18xx_scan_send()
118 cmd->role_id, band, in wl18xx_scan_send()
132 wl1271_dump(DEBUG_SCAN, "SCAN: ", cmd, sizeof(*cmd)); in wl18xx_scan_send()
134 ret = wl1271_cmd_send(wl, CMD_SCAN, cmd, sizeof(*cmd), 0); in wl18xx_scan_send()
142 kfree(cmd); in wl18xx_scan_send()
160 struct wl18xx_cmd_scan_params *cmd; in wl18xx_scan_sched_scan_config() local
172 cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); in wl18xx_scan_sched_scan_config()
173 if (!cmd) { in wl18xx_scan_sched_scan_config()
178 cmd->role_id = wlvif->role_id; in wl18xx_scan_sched_scan_config()
180 if (WARN_ON(cmd->role_id == WL12XX_INVALID_ROLE_ID)) { in wl18xx_scan_sched_scan_config()
185 cmd->scan_type = SCAN_TYPE_PERIODIC; in wl18xx_scan_sched_scan_config()
186 cmd->rssi_threshold = c->rssi_threshold; in wl18xx_scan_sched_scan_config()
187 cmd->snr_threshold = c->snr_threshold; in wl18xx_scan_sched_scan_config()
190 cmd->bss_type = SCAN_BSS_TYPE_ANY; in wl18xx_scan_sched_scan_config()
192 cmd->ssid_from_list = 1; in wl18xx_scan_sched_scan_config()
194 cmd->filter = 1; in wl18xx_scan_sched_scan_config()
195 cmd->add_broadcast = 0; in wl18xx_scan_sched_scan_config()
197 cmd->urgency = 0; in wl18xx_scan_sched_scan_config()
198 cmd->protect = 0; in wl18xx_scan_sched_scan_config()
200 cmd->n_probe_reqs = c->num_probe_reqs; in wl18xx_scan_sched_scan_config()
202 cmd->terminate_after = 0; in wl18xx_scan_sched_scan_config()
214 wl18xx_adjust_channels(cmd, cmd_channels); in wl18xx_scan_sched_scan_config()
218 cmd->short_cycles_msec = in wl18xx_scan_sched_scan_config()
220 cmd->long_cycles_msec = cpu_to_le16(c->long_interval); in wl18xx_scan_sched_scan_config()
221 cmd->short_cycles_count = c->num_short_intervals; in wl18xx_scan_sched_scan_config()
223 cmd->short_cycles_msec = 0; in wl18xx_scan_sched_scan_config()
224 cmd->long_cycles_msec = in wl18xx_scan_sched_scan_config()
226 cmd->short_cycles_count = 0; in wl18xx_scan_sched_scan_config()
229 le16_to_cpu(cmd->short_cycles_msec), in wl18xx_scan_sched_scan_config()
230 le16_to_cpu(cmd->long_cycles_msec), in wl18xx_scan_sched_scan_config()
231 cmd->short_cycles_count); in wl18xx_scan_sched_scan_config()
233 cmd->total_cycles = 0; in wl18xx_scan_sched_scan_config()
235 cmd->tag = WL1271_SCAN_DEFAULT_TAG; in wl18xx_scan_sched_scan_config()
238 cmd->report_threshold = 1; in wl18xx_scan_sched_scan_config()
239 cmd->terminate_on_report = 0; in wl18xx_scan_sched_scan_config()
241 if (cmd->active[0]) { in wl18xx_scan_sched_scan_config()
244 cmd->role_id, band, in wl18xx_scan_sched_scan_config()
258 if (cmd->active[1] || cmd->dfs) { in wl18xx_scan_sched_scan_config()
261 cmd->role_id, band, in wl18xx_scan_sched_scan_config()
275 wl1271_dump(DEBUG_SCAN, "SCAN: ", cmd, sizeof(*cmd)); in wl18xx_scan_sched_scan_config()
277 ret = wl1271_cmd_send(wl, CMD_SCAN, cmd, sizeof(*cmd), 0); in wl18xx_scan_sched_scan_config()
285 kfree(cmd); in wl18xx_scan_sched_scan_config()