Lines Matching +full:memcpy +full:- +full:channels
1 // SPDX-License-Identifier: GPL-2.0
15 * wl1251_cmd_send - Send command to firmware
30 cmd->id = id; in wl1251_cmd_send()
31 cmd->status = 0; in wl1251_cmd_send()
35 wl1251_mem_write(wl, wl->cmd_box_addr, buf, len); in wl1251_cmd_send()
45 ret = -ETIMEDOUT; in wl1251_cmd_send()
62 * wl1251_cmd_test - Send test command to firmware
90 wl1251_mem_read(wl, wl->cmd_box_addr, buf, buf_len); in wl1251_cmd_test()
94 if (cmd_answer->header.status != CMD_STATUS_SUCCESS) in wl1251_cmd_test()
96 cmd_answer->header.status); in wl1251_cmd_test()
103 * wl1251_cmd_interrogate - Read acx from firmware
117 acx->id = id; in wl1251_cmd_interrogate()
120 acx->len = len - sizeof(*acx); in wl1251_cmd_interrogate()
129 wl1251_mem_read(wl, wl->cmd_box_addr, buf, len); in wl1251_cmd_interrogate()
132 if (acx->cmd.status != CMD_STATUS_SUCCESS) in wl1251_cmd_interrogate()
134 acx->cmd.status); in wl1251_cmd_interrogate()
141 * wl1251_cmd_configure - Write acx value to firmware
155 acx->id = id; in wl1251_cmd_configure()
158 acx->len = len - sizeof(*acx); in wl1251_cmd_configure()
179 return -ENOMEM; in wl1251_cmd_vbm()
182 vbm->tim.bitmap_ctrl = bitmap_control; in wl1251_cmd_vbm()
188 memcpy(vbm->tim.pvb_field, bitmap, bitmap_len); in wl1251_cmd_vbm()
189 vbm->tim.identity = identity; in wl1251_cmd_vbm()
190 vbm->tim.length = bitmap_len + 3; in wl1251_cmd_vbm()
192 vbm->len = cpu_to_le16(bitmap_len + 5); in wl1251_cmd_vbm()
215 return -ENOMEM; in wl1251_cmd_data_path_rx()
217 cmd->channel = channel; in wl1251_cmd_data_path_rx()
249 return -ENOMEM; in wl1251_cmd_data_path_tx()
251 cmd->channel = channel; in wl1251_cmd_data_path_tx()
279 return -ENOMEM; in wl1251_cmd_join()
286 bssid = (u8 *) &join->bssid_lsb; in wl1251_cmd_join()
288 bssid[i] = wl->bssid[ETH_ALEN - i - 1]; in wl1251_cmd_join()
290 join->rx_config_options = wl->rx_config; in wl1251_cmd_join()
291 join->rx_filter_options = wl->rx_filter; in wl1251_cmd_join()
293 join->basic_rate_set = RATE_MASK_1MBPS | RATE_MASK_2MBPS | in wl1251_cmd_join()
296 join->beacon_interval = beacon_interval; in wl1251_cmd_join()
297 join->dtim_interval = dtim_interval; in wl1251_cmd_join()
298 join->bss_type = bss_type; in wl1251_cmd_join()
299 join->channel = channel; in wl1251_cmd_join()
300 join->ctrl = JOIN_CMD_CTRL_TX_FLUSH; in wl1251_cmd_join()
322 return -ENOMEM; in wl1251_cmd_ps_mode()
324 ps_params->ps_mode = ps_mode; in wl1251_cmd_ps_mode()
325 ps_params->send_null_data = 1; in wl1251_cmd_ps_mode()
326 ps_params->retries = 5; in wl1251_cmd_ps_mode()
327 ps_params->hang_over_period = 128; in wl1251_cmd_ps_mode()
328 ps_params->null_data_rate = 1; /* 1 Mbps */ in wl1251_cmd_ps_mode()
352 return -ENOMEM; in wl1251_cmd_read_memory()
357 cmd->addr = addr; in wl1251_cmd_read_memory()
358 cmd->size = len; in wl1251_cmd_read_memory()
367 wl1251_mem_read(wl, wl->cmd_box_addr, cmd, sizeof(*cmd)); in wl1251_cmd_read_memory()
369 if (cmd->header.status != CMD_STATUS_SUCCESS) in wl1251_cmd_read_memory()
371 cmd->header.status); in wl1251_cmd_read_memory()
373 memcpy(answer, cmd->value, len); in wl1251_cmd_read_memory()
395 return -ENOMEM; in wl1251_cmd_template_set()
397 cmd->size = cpu_to_le16(buf_len); in wl1251_cmd_template_set()
400 memcpy(cmd->data, buf, buf_len); in wl1251_cmd_template_set()
414 struct ieee80211_channel *channels[], in wl1251_cmd_scan() argument
420 wl1251_debug(DEBUG_CMD, "cmd scan channels %d", n_channels); in wl1251_cmd_scan()
426 return -ENOMEM; in wl1251_cmd_scan()
428 cmd->params.rx_config_options = cpu_to_le32(CFG_RX_ALL_GOOD); in wl1251_cmd_scan()
429 cmd->params.rx_filter_options = cpu_to_le32(CFG_RX_PRSP_EN | in wl1251_cmd_scan()
432 cmd->params.scan_options = 0; in wl1251_cmd_scan()
435 * causing never-ending scans (sometimes 20+ minutes). in wl1251_cmd_scan()
438 if (is_zero_ether_addr(wl->bssid)) in wl1251_cmd_scan()
439 cmd->params.scan_options |= cpu_to_le16(WL1251_SCAN_OPT_PRIORITY_HIGH); in wl1251_cmd_scan()
440 cmd->params.num_channels = n_channels; in wl1251_cmd_scan()
441 cmd->params.num_probe_requests = n_probes; in wl1251_cmd_scan()
442 cmd->params.tx_rate = cpu_to_le16(1 << 1); /* 2 Mbps */ in wl1251_cmd_scan()
443 cmd->params.tid_trigger = 0; in wl1251_cmd_scan()
446 cmd->channels[i].min_duration = in wl1251_cmd_scan()
448 cmd->channels[i].max_duration = in wl1251_cmd_scan()
450 memset(&cmd->channels[i].bssid_lsb, 0xff, 4); in wl1251_cmd_scan()
451 memset(&cmd->channels[i].bssid_msb, 0xff, 2); in wl1251_cmd_scan()
452 cmd->channels[i].early_termination = 0; in wl1251_cmd_scan()
453 cmd->channels[i].tx_power_att = 0; in wl1251_cmd_scan()
454 cmd->channels[i].channel = channels[i]->hw_value; in wl1251_cmd_scan()
460 cmd->params.ssid_len = len; in wl1251_cmd_scan()
461 memcpy(cmd->params.ssid, ssid, len); in wl1251_cmd_scan()
470 wl1251_mem_read(wl, wl->cmd_box_addr, cmd, sizeof(*cmd)); in wl1251_cmd_scan()
472 if (cmd->header.status != CMD_STATUS_SUCCESS) { in wl1251_cmd_scan()
474 cmd->header.status); in wl1251_cmd_scan()
475 ret = -EIO; in wl1251_cmd_scan()
493 return -ENOMEM; in wl1251_cmd_trigger_scan_to()
495 cmd->timeout = timeout; in wl1251_cmd_trigger_scan_to()