xpires: Thu, 07 Aug 2036 16:18:32 GMT ETag: "e5874186f9d7570827da539a860bdd9024b3a701" /* SPDX-License-Identifier: GPL-2.0-only */ /* * This file is part of wl1251 * * Copyright (c) 1998-2007 Texas Instruments Incorporated * Copyright (C) 2008 Nokia Corporation */ #ifndef __WL1251_CMD_H__ #define __WL1251_CMD_H__ #include "wl1251.h" #include struct acx_header; int wl1251_cmd_send(struct wl1251 *wl, u16 type, void *buf, size_t buf_len); int wl1251_cmd_test(struct wl1251 *wl, void *buf, size_t buf_len, u8 answer); int wl1251_cmd_interrogate(struct wl1251 *wl, u16 id, void *buf, size_t len); int wl1251_cmd_configure(struct wl1251 *wl, u16 id, void *buf, size_t len); int wl1251_cmd_vbm(struct wl1251 *wl, u8 identity, void *bitmap, u16 bitmap_len, u8 bitmap_control); int wl1251_cmd_data_path_rx(struct wl1251 *wl, u8 channel, bool enable); int wl1251_cmd_data_path_tx(struct wl1251 *wl, u8 channel, bool enable); int wl1251_cmd_join(struct wl1251 *wl, u8 bss_type, u8 channel, u16 beacon_interval, u8 dtim_interval); int wl1251_cmd_ps_mode(struct wl1251 *wl, u8 ps_mode); int wl1251_cmd_read_memory(struct wl1251 *wl, u32 addr, void *answer, size_t len); int wl1251_cmd_template_set(struct wl1251 *wl, u16 cmd_id, void *buf, size_t buf_len); int wl1251_cmd_scan(struct wl1251 *wl, u8 *ssid, size_t ssid_len, struct ieee80211_channel *channels[], unsigned int n_channels, unsigned int n_probes); int wl1251_cmd_trigger_scan_to(struct wl1251 *wl, u32 timeout); /* unit ms */ #define WL1251_COMMAND_TIMEOUT 2000 enum wl1251_commands { CMD_RESET = 0, CMD_INTERROGATE = 1, /*use this to read information elements*/ CMD_CONFIGURE = 2, /*use this to write information elements*/ CMD_ENABLE_RX = 3, CMD_ENABLE_TX = 4, CMD_DISABLE_RX = 5, CMD_DISABLE_TX = 6, CMD_SCAN = 8, CMD_STOP_SCAN = 9, CMD_VBM = 10, CMD_START_JOIN = 11, CMD_SET_KEYS = 12, CMD_READ_MEMORY = 13, CMD_WRITE_MEMORY = 14, CMD_BEACON = 19, CMD_PROBE_RESP = 20, CMD_NULL_DATA = 21, CMD_PROBE_REQ = 22, CMD_TEST = 23, CMD_RADIO_CALIBRATE = 25, /* OBSOLETE */ CMD_ENABLE_RX_PATH = 27, /* OBSOLETE */ CMD_NOISE_HIST = 28, CMD_RX_RESET = 29, CMD_PS_POLL = 30, CMD_QOS_NULL_DATA = 31, CMD_LNA_CONTROL = 32, CMD_SET_BCN_MODE = 33, CMD_MEASUREMENT = 34, CMD_STOP_MEASUREMENT = 35, CMD_DISCONNECT = 36, CMD_SET_PS_MODE = 37, CMD_CHANNEL_SWITCH = 38, CMD_STOP_CHANNEL_SWICTH = 39, CMD_AP_DISCOVERY = 40, CMD_STOP_AP_DISCOVERY = 41, CMD_SPS_SCAN = 42, CMD_STOP_SPS_SCAN = 43, CMD_HEALTH_CHECK = 45, CMD_DEBUG = 46, CMD_TRIGGER_SCAN_TO = 47, NUM_COMMANDS, MAX_COMMAND_ID = 0xFFFF, }; #define MAX_CMD_PARAMS 572 struct wl1251_cmd_header { u16 id; u16 status; /* payload */ u8 data[]; } __packed; struct wl1251_command { struct wl1251_cmd_header header; u8 parameters[MAX_CMD_PARAMS]; } __packed; enum { CMD_MAILBOX_IDLE = 0, CMD_STATUS_SUCCESS = 1, CMD_STATUS_UNKNOWN_CMD = 2, CMD_STATUS_UNKNOWN_IE = 3, CMD_STATUS_REJECT_MEAS_SG_ACTIVE = 11, CMD_STATUS_RX_BUSY = 13, CMD_STATUS_INVALID_PARAM = 14, CMD_STATUS_TEMPLATE_TOO_LARGE = 15, CMD_STATUS_OUT_OF_MEMORY = 16, CMD_STATUS_STA_TABLE_FULL = 17, CMD_STATUS_RADIO_ERROR = 18, CMD_STATUS_WRONG_NESTING = 19, CMD_STATUS_TIMEOUT = 21, /* Driver internal use.*/ CMD_STATUS_FW_RESET = 22, /* Driver internal use.*/ MAX_COMMAND_STATUS = 0xff }; /* * CMD_READ_MEMORY * * The hos