Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 266581
b: refs/heads/master
c: e509044
h: refs/heads/master
i:
  266579: b5e24ef
v: v3
  • Loading branch information
Vivek Natarajan authored and Kalle Valo committed Sep 2, 2011
1 parent 4c0fae7 commit d4e9201
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b142b91401b8e39671db74bd4fe89f281f4c2978
refs/heads/master: e5090444be811ce45653969363be8fcb4c52d597
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/ath/ath6kl/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ struct ath6kl {
u16 bss_ch;
u16 listen_intvl_b;
u16 listen_intvl_t;
u8 lrssi_roam_threshold;
struct ath6kl_version version;
u32 target_type;
u8 tx_pwr;
Expand Down
47 changes: 47 additions & 0 deletions trunk/drivers/net/wireless/ath/ath6kl/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,51 @@ static const struct file_operations fops_reg_dump = {
.llseek = default_llseek,
};

static ssize_t ath6kl_lrssi_roam_write(struct file *file,
const char __user *user_buf,
size_t count, loff_t *ppos)
{
struct ath6kl *ar = file->private_data;
unsigned long lrssi_roam_threshold;
char buf[32];
ssize_t len;

len = min(count, sizeof(buf) - 1);
if (copy_from_user(buf, user_buf, len))
return -EFAULT;

buf[len] = '\0';
if (strict_strtoul(buf, 0, &lrssi_roam_threshold))
return -EINVAL;

ar->lrssi_roam_threshold = lrssi_roam_threshold;

ath6kl_wmi_set_roam_lrssi_cmd(ar->wmi, ar->lrssi_roam_threshold);

return count;
}

static ssize_t ath6kl_lrssi_roam_read(struct file *file,
char __user *user_buf,
size_t count, loff_t *ppos)
{
struct ath6kl *ar = file->private_data;
char buf[32];
unsigned int len;

len = snprintf(buf, sizeof(buf), "%u\n", ar->lrssi_roam_threshold);

return simple_read_from_buffer(user_buf, count, ppos, buf, len);
}

static const struct file_operations fops_lrssi_roam_threshold = {
.read = ath6kl_lrssi_roam_read,
.write = ath6kl_lrssi_roam_write,
.open = ath6kl_debugfs_open,
.owner = THIS_MODULE,
.llseek = default_llseek,
};

int ath6kl_debug_init(struct ath6kl *ar)
{
ar->debug.fwlog_buf.buf = vmalloc(ATH6KL_FWLOG_SIZE);
Expand Down Expand Up @@ -760,6 +805,8 @@ int ath6kl_debug_init(struct ath6kl *ar)
debugfs_create_file("reg_dump", S_IRUSR, ar->debugfs_phy, ar,
&fops_reg_dump);

debugfs_create_file("lrssi_roam_threshold", S_IRUSR | S_IWUSR,
ar->debugfs_phy, ar, &fops_lrssi_roam_threshold);
return 0;
}

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/ath/ath6kl/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ static void ath6kl_init_control_info(struct ath6kl *ar)
memset(&ar->sc_params, 0, sizeof(ar->sc_params));
ar->sc_params.short_scan_ratio = WMI_SHORTSCANRATIO_DEFAULT;
ar->sc_params.scan_ctrl_flags = DEFAULT_SCAN_CTRL_FLAGS;
ar->lrssi_roam_threshold = DEF_LRSSI_ROAM_THRESHOLD;

memset((u8 *)ar->sta_list, 0,
AP_MAX_NUM_STA * sizeof(struct ath6kl_sta));
Expand Down
29 changes: 29 additions & 0 deletions trunk/drivers/net/wireless/ath/ath6kl/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,35 @@ static int ath6kl_wmi_ready_event_rx(struct wmi *wmi, u8 *datap, int len)
return 0;
}

/*
* Mechanism to modify the roaming behavior in the firmware. The lower rssi
* at which the station has to roam can be passed with
* WMI_SET_LRSSI_SCAN_PARAMS. Subtract 96 from RSSI to get the signal level
* in dBm.
*/
int ath6kl_wmi_set_roam_lrssi_cmd(struct wmi *wmi, u8 lrssi)
{
struct sk_buff *skb;
struct roam_ctrl_cmd *cmd;

skb = ath6kl_wmi_get_new_buf(sizeof(*cmd));
if (!skb)
return -ENOMEM;

cmd = (struct roam_ctrl_cmd *) skb->data;

cmd->info.params.lrssi_scan_period = cpu_to_le16(DEF_LRSSI_SCAN_PERIOD);
cmd->info.params.lrssi_scan_threshold = a_cpu_to_sle16(lrssi +
DEF_SCAN_FOR_ROAM_INTVL);
cmd->info.params.lrssi_roam_threshold = a_cpu_to_sle16(lrssi);
cmd->info.params.roam_rssi_floor = DEF_LRSSI_ROAM_FLOOR;
cmd->roam_ctrl = WMI_SET_LRSSI_SCAN_PARAMS;

ath6kl_wmi_cmd_send(wmi, skb, WMI_SET_ROAM_CTRL_CMDID, NO_SYNC_WMIFLAG);

return 0;
}

static int ath6kl_wmi_connect_event_rx(struct wmi *wmi, u8 *datap, int len)
{
struct wmi_connect_event *ev;
Expand Down
41 changes: 41 additions & 0 deletions trunk/drivers/net/wireless/ath/ath6kl/wmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -1333,6 +1333,46 @@ enum wmi_bi_ftype {
PROBEREQ_FTYPE,
};

#define DEF_LRSSI_SCAN_PERIOD 5
#define DEF_LRSSI_ROAM_THRESHOLD 20
#define DEF_LRSSI_ROAM_FLOOR 60
#define DEF_SCAN_FOR_ROAM_INTVL 2

enum wmi_roam_ctrl {
WMI_FORCE_ROAM = 1,
WMI_SET_ROAM_MODE,
WMI_SET_HOST_BIAS,
WMI_SET_LRSSI_SCAN_PARAMS,
};

struct bss_bias {
u8 bssid[ETH_ALEN];
u8 bias;
} __packed;

struct bss_bias_info {
u8 num_bss;
struct bss_bias bss_bias[1];
} __packed;

struct low_rssi_scan_params {
__le16 lrssi_scan_period;
a_sle16 lrssi_scan_threshold;
a_sle16 lrssi_roam_threshold;
u8 roam_rssi_floor;
u8 reserved[1];
} __packed;

struct roam_ctrl_cmd {
union {
u8 bssid[ETH_ALEN];
u8 roam_mode;
struct bss_bias_info bss;
struct low_rssi_scan_params params;
} __packed info;
u8 roam_ctrl;
} __packed;

struct wmi_bss_info_hdr {
__le16 ch;

Expand Down Expand Up @@ -2190,6 +2230,7 @@ int ath6kl_wmi_test_cmd(struct wmi *wmi, void *buf, size_t len);
s32 ath6kl_wmi_get_rate(s8 rate_index);

int ath6kl_wmi_set_ip_cmd(struct wmi *wmi, struct wmi_set_ip_cmd *ip_cmd);
int ath6kl_wmi_set_roam_lrssi_cmd(struct wmi *wmi, u8 lrssi);

struct bss *ath6kl_wmi_find_ssid_node(struct wmi *wmi, u8 *ssid,
u32 ssid_len, bool is_wpa2,
Expand Down

0 comments on commit d4e9201

Please sign in to comment.