Skip to content

Commit

Permalink
wlcore: apply the api changes of scan
Browse files Browse the repository at this point in the history
still need to change the code...
  • Loading branch information
elp committed Aug 3, 2012
1 parent dde768a commit 7f0a3f3
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 57 deletions.
42 changes: 19 additions & 23 deletions drivers/net/wireless/ti/wlcore/cmd.h
Expand Up @@ -120,37 +120,33 @@ enum wl1271_commands {
CMD_STOP_AP_DISCOVERY = 23,
CMD_HEALTH_CHECK = 24,
CMD_DEBUG = 25,
CMD_TRIGGER_SCAN_TO = 26,
CMD_CONNECTION_SCAN_CFG = 27,
CMD_CONNECTION_SCAN_SSID_CFG = 28,
CMD_START_PERIODIC_SCAN = 29,
CMD_STOP_PERIODIC_SCAN = 30,
CMD_SET_PEER_STATE = 31,
CMD_REMAIN_ON_CHANNEL = 32,
CMD_CANCEL_REMAIN_ON_CHANNEL = 33,
CMD_CONFIG_FWLOGGER = 34,
CMD_START_FWLOGGER = 35,
CMD_STOP_FWLOGGER = 36,
CMD_CONNECTION_SCAN_SSID_CFG = 26,
CMD_SET_PEER_STATE = 27,
CMD_REMAIN_ON_CHANNEL = 28,
CMD_CANCEL_REMAIN_ON_CHANNEL = 29,
CMD_CONFIG_FWLOGGER = 30,
CMD_START_FWLOGGER = 31,
CMD_STOP_FWLOGGER = 32,

/* Access point commands */
CMD_ADD_PEER = 37,
CMD_REMOVE_PEER = 38,
CMD_ADD_PEER = 33,
CMD_REMOVE_PEER = 34,

/* Role API */
CMD_ROLE_ENABLE = 39,
CMD_ROLE_DISABLE = 40,
CMD_ROLE_START = 41,
CMD_ROLE_STOP = 42,
CMD_ROLE_ENABLE = 35,
CMD_ROLE_DISABLE = 36,
CMD_ROLE_START = 37,
CMD_ROLE_STOP = 38,

/* DFS */
CMD_START_RADAR_DETECTION = 43,
CMD_STOP_RADAR_DETECTION = 44,
CMD_START_RADAR_DETECTION = 39,
CMD_STOP_RADAR_DETECTION = 40,

/* WIFI Direct */
CMD_WFD_START_DISCOVERY = 45,
CMD_WFD_STOP_DISCOVERY = 46,
CMD_WFD_ATTRIBUTE_CONFIG = 47,
CMD_NOP = 48,
CMD_WFD_START_DISCOVERY = 41,
CMD_WFD_STOP_DISCOVERY = 42,
CMD_WFD_ATTRIBUTE_CONFIG = 43,
CMD_NOP = 44,
CMD_LAST_COMMAND,

MAX_COMMAND_ID = 0xFFFF,
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/ti/wlcore/scan.c
Expand Up @@ -436,6 +436,7 @@ static int wl1271_scan_send(struct wl1271 *wl, struct ieee80211_vif *vif,

wl1271_dump(DEBUG_SCAN, "SCAN: ", cmd, sizeof(*cmd));

wl1271_info("scan size: %d", sizeof(*cmd));
ret = wl1271_cmd_send(wl, CMD_SCAN, cmd, sizeof(*cmd), 0);
if (ret < 0) {
wl1271_error("SCAN failed");
Expand Down
102 changes: 68 additions & 34 deletions drivers/net/wireless/ti/wlcore/scan.h
Expand Up @@ -65,20 +65,21 @@ enum {
WL1271_SCAN_STATE_5GHZ_PASSIVE,
WL1271_SCAN_STATE_DONE
};

#if 0
struct basic_scan_params {
/* Scan option flags (WL1271_SCAN_OPT_*) */
__le16 scan_options;
u8 scan_options;
u8 role_id;
/* Number of scan channels in the list (maximum 30) */
u8 n_ch;
/* This field indicates the number of probe requests to send
per channel for an active scan */
u8 n_probe_reqs;
u8 tid_trigger;
//u8 tid_trigger;
u8 ssid_len;
u8 use_ssid_list;

/* TODO: padding */
/* Rate bit field for sending the probes */
__le32 tx_rate;

Expand Down Expand Up @@ -110,20 +111,16 @@ struct wl1271_cmd_scan {

struct basic_scan_params params;
struct basic_scan_channel_params channels[WL1271_SCAN_MAX_CHANNELS];

/* src mac address */
u8 addr[ETH_ALEN];
u8 padding[2];
} __packed;

#endif
struct wl1271_cmd_trigger_scan_to {
struct wl1271_cmd_header header;

__le32 timeout;
} __packed;

#define MAX_CHANNELS_2GHZ 14
#define MAX_CHANNELS_5GHZ 23
#define MAX_CHANNELS_5GHZ 24
#define MAX_CHANNELS_4GHZ 4

#define SCAN_MAX_CYCLE_INTERVALS 16
Expand Down Expand Up @@ -166,40 +163,70 @@ struct conn_scan_ch_params {
u8 padding[3];
} __packed;

struct wl1271_cmd_sched_scan_config {
struct wl1271_cmd_header header;

__le32 intervals[SCAN_MAX_CYCLE_INTERVALS];
struct tracking_ch_params {
struct conn_scan_ch_params channel;

s8 rssi_threshold; /* for filtering (in dBm) */
s8 snr_threshold; /* for filtering (in dB) */
__le32 bssid_lsb;
__le16 bssid_msb;

u8 cycles; /* maximum number of scan cycles */
u8 report_after; /* report when this number of results are received */
u8 terminate; /* stop scanning after reporting */
u8 padding[2];
} __packed;

u8 tag;
u8 bss_type; /* for filtering */
u8 filter_type;
enum
{
SCAN_TYPE_SEARCH = 0,
SCAN_TYPE_PERIODIC = 1,
SCAN_TYPE_TRACKING = 2,
};

u8 ssid_len; /* For SCAN_SSID_FILTER_SPECIFIC */
u8 ssid[IEEE80211_MAX_SSID_LEN];
struct wl1271_cmd_scan_params {
struct wl1271_cmd_header header;

u8 n_probe_reqs; /* Number of probes requests per channel */
u8 role_id;
u8 scan_type;

u8 passive[SCAN_MAX_BANDS];
u8 active[SCAN_MAX_BANDS];
s8 rssi_threshold; /* for filtering (in dBm) */
s8 snr_threshold; /* for filtering (in dB) */

u8 dfs;
u8 bss_type; /* for filtering */
u8 ssid_from_list; /* use ssid from configured ssid list */
u8 filter; /* forward only results with matching ssids */

/*
* add broadcast ssid in addition to the configured ssids.
* the driver should add dummy entry for it (?).
*/
u8 add_broadcast;

u8 urgency;
u8 protect; /* ??? */
u8 n_probe_reqs; /* Number of probes requests per channel */
u8 terminate_after; /* early terminate scan operation */

u8 passive[SCAN_MAX_BANDS]; /* number of passive scan channels */
u8 active[SCAN_MAX_BANDS]; /* number of active scan channels */
u8 dfs; /* number of dfs channels in 5ghz */
u8 passive_active; /* number of passive before active channels 2.4ghz */

__le16 short_cycles_sec;
__le16 long_cycles_sec;
u8 short_cycles_count;
u8 total_cycles; /* 0 - infinite */
u8 padding[2];

u8 n_pactive_ch; /* number of pactive (passive until fw detects energy)
channels in BG band */
u8 role_id;
u8 padding[1];
union {
struct {
struct conn_scan_ch_params channels_2[MAX_CHANNELS_2GHZ];
struct conn_scan_ch_params channels_5[MAX_CHANNELS_5GHZ];
struct conn_scan_ch_params channels_4[MAX_CHANNELS_4GHZ];
};
struct tracking_ch_params channels_tracking[WL1271_SCAN_MAX_CHANNELS];
} ;

struct conn_scan_ch_params channels_2[MAX_CHANNELS_2GHZ];
struct conn_scan_ch_params channels_5[MAX_CHANNELS_5GHZ];
struct conn_scan_ch_params channels_4[MAX_CHANNELS_4GHZ];
u8 ssid[IEEE80211_MAX_SSID_LEN];
u8 ssid_len; /* For SCAN_SSID_FILTER_SPECIFIC */
u8 tag;
u8 padding1[2];
} __packed;


Expand Down Expand Up @@ -242,5 +269,12 @@ struct wl1271_cmd_sched_scan_stop {
u8 padding[2];
} __packed;

struct wl12xx_cmd_scan_stop {
struct wl1271_cmd_header header;

u8 role_id;
u8 scan_type;
u8 padding[2];
} __packed;

#endif /* __WL1271_SCAN_H__ */

0 comments on commit 7f0a3f3

Please sign in to comment.