ath6kl: Retain bg scan period value modified by the user
authorRaja Mani <rmani@qca.qualcomm.com>
Mon, 16 Apr 2012 10:39:56 +0000 (16:09 +0530)
committerKalle Valo <kvalo@qca.qualcomm.com>
Wed, 18 Apr 2012 09:56:38 +0000 (12:56 +0300)
Added a new member bg_scan_period in struct ath6kl_vif
to retain background scan period value configured via debugfs
entry 'bgscan_interval'. This backup is needed in schedule scan
path while configuring scan parameters.

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath6kl/cfg80211.c
drivers/net/wireless/ath/ath6kl/core.h
drivers/net/wireless/ath/ath6kl/debug.c

index c5e90d30c672a20a123d6a561c226de7a05da09d..20881334da602c38951cb4318b5f9dafa91f3b7a 100644 (file)
@@ -3370,6 +3370,7 @@ struct net_device *ath6kl_interface_add(struct ath6kl *ar, char *name,
        vif->next_mode = nw_type;
        vif->listen_intvl_t = ATH6KL_DEFAULT_LISTEN_INTVAL;
        vif->bmiss_time_t = ATH6KL_DEFAULT_BMISS_TIME;
+       vif->bg_scan_period = 0;
        vif->htcap.ht_enable = true;
 
        memcpy(ndev->dev_addr, ar->mac_addr, ETH_ALEN);
index 280f305e599d5ccece8f7e3eb3668d6a36c68fd5..a97cb836106a2721d80c0f633f3ab45fa8740cd0 100644 (file)
@@ -557,6 +557,7 @@ struct ath6kl_vif {
        u16 assoc_bss_beacon_int;
        u16 listen_intvl_t;
        u16 bmiss_time_t;
+       u16 bg_scan_period;
        u8 assoc_bss_dtim_period;
        struct net_device_stats net_stats;
        struct target_stats target_stats;
index 496382f472def00b09fdf9878cf0f47decc8b11a..acb6430d8e7e6e6d6b654372bde16c5bc4801a85 100644 (file)
@@ -1578,10 +1578,15 @@ static ssize_t ath6kl_bgscan_int_write(struct file *file,
                                size_t count, loff_t *ppos)
 {
        struct ath6kl *ar = file->private_data;
+       struct ath6kl_vif *vif;
        u16 bgscan_int;
        char buf[32];
        ssize_t len;
 
+       vif = ath6kl_vif_first(ar);
+       if (!vif)
+               return -EIO;
+
        len = min(count, sizeof(buf) - 1);
        if (copy_from_user(buf, user_buf, len))
                return -EFAULT;
@@ -1593,6 +1598,8 @@ static ssize_t ath6kl_bgscan_int_write(struct file *file,
        if (bgscan_int == 0)
                bgscan_int = 0xffff;
 
+       vif->bg_scan_period = bgscan_int;
+
        ath6kl_wmi_scanparams_cmd(ar->wmi, 0, 0, 0, bgscan_int, 0, 0, 0, 3,
                                  0, 0, 0);