aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorEcco Park <eccopark@broadcom.com>2013-09-07 09:46:12 +0900
committerZiyan <jaraidaniel@gmail.com>2016-05-01 23:35:25 +0200
commit4b61fb737694337c54458490c1942ef705d3460f (patch)
treead4cdd3cfec6f43380482bdeab97f2a10cfd38a0 /drivers
parent3f3ca7ecd93141474ef2b9b9d1fc17e616ac15e2 (diff)
downloadkernel_samsung_tuna-4b61fb737694337c54458490c1942ef705d3460f.zip
kernel_samsung_tuna-4b61fb737694337c54458490c1942ef705d3460f.tar.gz
kernel_samsung_tuna-4b61fb737694337c54458490c1942ef705d3460f.tar.bz2
net: wireless: bcmdhd: Update Location Service code
updated the dhd_pno.c based on new firmware which will be released today. updated the wl_anroid.c based on Robert's requirement Signed-off-by: Ecco Park <eccopark@broadcom.com> Conflicts: drivers/net/wireless/bcmdhd/common/include/proto/bcmevent.h Change-Id: I270755fe4c041ea1282afaed9d120c9b83c2bc0c
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/bcmdhd/common/include/proto/bcmevent.h9
-rw-r--r--drivers/net/wireless/bcmdhd/dhd_pno.c24
-rw-r--r--drivers/net/wireless/bcmdhd/include/wlioctl.h47
-rw-r--r--drivers/net/wireless/bcmdhd/wl_android.c6
4 files changed, 57 insertions, 29 deletions
diff --git a/drivers/net/wireless/bcmdhd/common/include/proto/bcmevent.h b/drivers/net/wireless/bcmdhd/common/include/proto/bcmevent.h
index d9e05d5..c886c3f 100644
--- a/drivers/net/wireless/bcmdhd/common/include/proto/bcmevent.h
+++ b/drivers/net/wireless/bcmdhd/common/include/proto/bcmevent.h
@@ -151,8 +151,9 @@ typedef BWL_PRE_PACKED_STRUCT struct bcm_event {
#define WLC_E_IF 54 /* I/F change (for dongle host notification) */
#define WLC_E_P2P_DISC_LISTEN_COMPLETE 55 /* listen state expires */
#define WLC_E_RSSI 56 /* indicate RSSI change based on configured levels */
-#define WLC_E_PFN_BEST_BATCHING 57 /* PFN best network batching event of out of memory */
#define WLC_E_PFN_SCAN_COMPLETE 57 /* PFN completed scan of network list */
+/* PFN best network batching event, conflict/share with WLC_E_PFN_SCAN_COMPLETE */
+#define WLC_E_PFN_BEST_BATCHING 57
#define WLC_E_EXTLOG_MSG 58
#define WLC_E_ACTION_FRAME 59 /* Action frame Rx */
#define WLC_E_ACTION_FRAME_COMPLETE 60 /* Action frame Tx complete */
@@ -179,10 +180,12 @@ typedef BWL_PRE_PACKED_STRUCT struct bcm_event {
#define WLC_E_OVERLAY_REQ 79 /* request an overlay IOCTL/iovar from the host */
#define WLC_E_CSA_COMPLETE_IND 80 /* 802.11 CHANNEL SWITCH ACTION completed */
#define WLC_E_EXCESS_PM_WAKE_EVENT 81 /* excess PM Wake Event to inform host */
-#define WLC_E_PFN_BSSID_NET_FOUND 82 /* PFN BSSID network found event */
#define WLC_E_PFN_SCAN_NONE 82 /* no PFN networks around */
-#define WLC_E_PFN_BSSID_NET_LOST 83 /* PFN BSSID network lost event */
+/* PFN BSSID network found event, conflict/share with WLC_E_PFN_SCAN_NONE */
+#define WLC_E_PFN_BSSID_NET_FOUND 82
#define WLC_E_PFN_SCAN_ALLGONE 83 /* last found PFN network gets lost */
+/* PFN BSSID network lost event, conflict/share with WLC_E_PFN_SCAN_ALLGONE */
+#define WLC_E_PFN_BSSID_NET_LOST 83
#define WLC_E_GTK_PLUMBED 84
#define WLC_E_ASSOC_IND_NDIS 85 /* 802.11 ASSOC indication for NDIS only */
#define WLC_E_REASSOC_IND_NDIS 86 /* 802.11 REASSOC indication for NDIS only */
diff --git a/drivers/net/wireless/bcmdhd/dhd_pno.c b/drivers/net/wireless/bcmdhd/dhd_pno.c
index 3a5d27d..a604024 100644
--- a/drivers/net/wireless/bcmdhd/dhd_pno.c
+++ b/drivers/net/wireless/bcmdhd/dhd_pno.c
@@ -297,13 +297,13 @@ _dhd_pno_set(dhd_pub_t *dhd, const dhd_pno_params_t *pno_params, dhd_pno_mode_t
if (mode == DHD_PNO_BATCH_MODE) {
int _tmp = pfn_param.bestn;
/* set bestn to calculate the max mscan which firmware supports */
- err = dhd_iovar(dhd, 0, "pfnmscan", (char *)&_tmp, sizeof(_tmp), 1);
+ err = dhd_iovar(dhd, 0, "pfnmem", (char *)&_tmp, sizeof(_tmp), 1);
if (err < 0) {
DHD_ERROR(("%s : failed to set pfnmscan\n", __FUNCTION__));
goto exit;
}
/* get max mscan which the firmware supports */
- err = dhd_iovar(dhd, 0, "pfnmscan", (char *)&_tmp, sizeof(_tmp), 0);
+ err = dhd_iovar(dhd, 0, "pfnmem", (char *)&_tmp, sizeof(_tmp), 0);
if (err < 0) {
DHD_ERROR(("%s : failed to get pfnmscan\n", __FUNCTION__));
goto exit;
@@ -1117,6 +1117,7 @@ exit:
kfree(p_ssid_list);
return err;
}
+
static int
_dhd_pno_get_for_batch(dhd_pub_t *dhd, char *buf, int bufsize, int reason)
{
@@ -1219,10 +1220,10 @@ _dhd_pno_get_for_batch(dhd_pub_t *dhd, char *buf, int bufsize, int reason)
}
DHD_PNO(("ver %d, status : %d, count %d\n", plbestnet->version,
plbestnet->status, plbestnet->count));
- if (plbestnet->version != PFN_LSCANRESULT_VERSION) {
+ if (plbestnet->version != PFN_SCANRESULT_VERSION) {
err = BCME_VERSION;
DHD_ERROR(("bestnet version(%d) is mismatch with Driver version(%d)\n",
- plbestnet->version, PFN_LSCANRESULT_VERSION));
+ plbestnet->version, PFN_SCANRESULT_VERSION));
goto exit;
}
plnetinfo = plbestnet->netinfo;
@@ -1274,11 +1275,11 @@ _dhd_pno_get_for_batch(dhd_pub_t *dhd, char *buf, int bufsize, int reason)
/* fills the best network info */
pbestnet_entry->channel = plnetinfo->pfnsubnet.channel;
pbestnet_entry->RSSI = plnetinfo->RSSI;
- if (pbestnet_entry->RSSI > 0) {
+ if (plnetinfo->flags & PFN_PARTIAL_SCAN_MASK) {
/* if RSSI is positive value, we assume that
* this scan is aborted by other scan
*/
- pbestnet_entry->RSSI *= -1;
+ DHD_PNO(("This scan is aborted\n"));
pbestnetheader->reason = (ENABLE << PNO_STATUS_ABORT);
}
pbestnet_entry->rtt0 = plnetinfo->rtt0;
@@ -1324,18 +1325,17 @@ _dhd_pno_get_for_batch(dhd_pub_t *dhd, char *buf, int bufsize, int reason)
list_move_tail(&siter->list,
&_params->params_batch.get_batch.expired_scan_results_list);
}
+ /* reset gloval values after moving to expired list */
_params->params_batch.get_batch.top_node_cnt = 0;
_params->params_batch.get_batch.expired_tot_scan_cnt =
_params->params_batch.get_batch.tot_scan_cnt;
_params->params_batch.get_batch.tot_scan_cnt = 0;
}
convert_format:
- if (!list_empty(&_params->params_batch.get_batch.expired_scan_results_list)) {
- err = _dhd_pno_convert_format(dhd, &_params->params_batch, buf, bufsize);
- if (err < 0) {
- DHD_ERROR(("failed to convert the data into upper layer format\n"));
- goto exit;
- }
+ err = _dhd_pno_convert_format(dhd, &_params->params_batch, buf, bufsize);
+ if (err < 0) {
+ DHD_ERROR(("failed to convert the data into upper layer format\n"));
+ goto exit;
}
}
exit:
diff --git a/drivers/net/wireless/bcmdhd/include/wlioctl.h b/drivers/net/wireless/bcmdhd/include/wlioctl.h
index 04bb09f..2d0f90e 100644
--- a/drivers/net/wireless/bcmdhd/include/wlioctl.h
+++ b/drivers/net/wireless/bcmdhd/include/wlioctl.h
@@ -3869,6 +3869,7 @@ enum {
#define IMMEDIATE_EVENT_BIT 8
#define SUPPRESS_SSID_BIT 9
#define ENABLE_NET_OFFLOAD_BIT 10
+/* report found/lost events for SSID and BSSID networks seperately */
#define REPORT_SEPERATELY_BIT 11
#define SORT_CRITERIA_MASK 0x0001
@@ -3882,22 +3883,23 @@ enum {
#define IMMEDIATE_EVENT_MASK 0x0100
#define SUPPRESS_SSID_MASK 0x0200
#define ENABLE_NET_OFFLOAD_MASK 0x0400
-#define REPORT_SEPERATELY_MASK 0x800
+/* report found/lost events for SSID and BSSID networks seperately */
+#define REPORT_SEPERATELY_MASK 0x0800
#define PFN_VERSION 2
#define PFN_SCANRESULT_VERSION 1
-#define PFN_LSCANRESULT_VERSION 2
#define MAX_PFN_LIST_COUNT 16
#define PFN_COMPLETE 1
#define PFN_INCOMPLETE 0
-#define PFN_OUTOFMEMORY 2
#define DEFAULT_BESTN 2
#define DEFAULT_MSCAN 0
#define DEFAULT_REPEAT 10
-#define DEFAULT_EXP 2
-#define DEFAULT_RTTN 0
+#define DEFAULT_EXP 2
+
+#define PFN_PARTIAL_SCAN_BIT 0
+#define PFN_PARTIAL_SCAN_MASK 1
/* PFN network info structure */
typedef struct wl_pfn_subnet_info {
@@ -3914,11 +3916,12 @@ typedef struct wl_pfn_net_info {
} wl_pfn_net_info_t;
typedef struct wl_pfn_lnet_info {
- wl_pfn_subnet_info_t pfnsubnet;
- int32 RSSI;
- uint32 timestamp;
- uint16 rtt0;
- uint16 rtt1;
+ wl_pfn_subnet_info_t pfnsubnet; /* BSSID + channel + SSID len + SSID */
+ uint16 flags; /* partial scan, etc */
+ int16 RSSI; /* receive signal strength (in dBm) */
+ uint32 timestamp; /* age in miliseconds */
+ uint16 rtt0; /* estimated distance to this AP in centimeters */
+ uint16 rtt1; /* standard deviation of the distance to this AP in centimeters */
} wl_pfn_lnet_info_t;
typedef struct wl_pfn_lscanresults {
@@ -3956,7 +3959,6 @@ typedef struct wl_pfn_param {
*/
uint8 exp; /* Exponent of 2 for maximum scan interval */
int32 slow_freq; /* slow scan period */
- uint8 rttn;
} wl_pfn_param_t;
typedef struct wl_pfn_bssid {
@@ -3970,14 +3972,18 @@ typedef struct wl_pfn_bssid {
#define WL_PFN_RSSI_SHIFT 8
typedef struct wl_pfn_cfg {
- uint32 reporttype;
- int32 channel_num;
- uint16 channel_list[WL_NUMCHANNELS];
+ uint32 reporttype;
+ int32 channel_num;
+ uint16 channel_list[WL_NUMCHANNELS];
+ uint32 flags;
} wl_pfn_cfg_t;
#define WL_PFN_REPORT_ALLNET 0
#define WL_PFN_REPORT_SSIDNET 1
#define WL_PFN_REPORT_BSSIDNET 2
+#define WL_PFN_CFG_FLAGS_PROHIBITED 0x00000001 /* Accept and use prohibited channels */
+#define WL_PFN_CFG_FLAGS_RESERVED 0xfffffffe /* Remaining reserved for future use */
+
typedef struct wl_pfn {
wlc_ssid_t ssid; /* ssid name and its length */
int32 flags; /* bit2: hidden */
@@ -3986,11 +3992,24 @@ typedef struct wl_pfn {
int32 wpa_auth; /* WPA type */
int32 wsec; /* wsec value */
} wl_pfn_t;
+typedef struct wl_pfn_list {
+ uint32 version;
+ uint32 enabled;
+ uint32 count;
+ wl_pfn_t pfn[1];
+} wl_pfn_list_t;
#define WL_PFN_HIDDEN_BIT 2
#define PNO_SCAN_MAX_FW 508*1000 /* max time scan time in msec */
#define PNO_SCAN_MAX_FW_SEC PNO_SCAN_MAX_FW/1000 /* max time scan time in SEC */
#define PNO_SCAN_MIN_FW_SEC 10 /* min time scan time in SEC */
#define WL_PFN_HIDDEN_MASK 0x4
+#ifndef BESTN_MAX
+#define BESTN_MAX 3
+#endif
+
+#ifndef MSCAN_MAX
+#define MSCAN_MAX 90
+#endif
#endif /* LINUX_POSTMOGRIFY_REMOVAL */
diff --git a/drivers/net/wireless/bcmdhd/wl_android.c b/drivers/net/wireless/bcmdhd/wl_android.c
index c848a05..7e50bec 100644
--- a/drivers/net/wireless/bcmdhd/wl_android.c
+++ b/drivers/net/wireless/bcmdhd/wl_android.c
@@ -372,6 +372,9 @@ wls_parse_batching_cmd(struct net_device *dev, char *command, int total_len)
err = dhd_dev_pno_set_for_batch(dev, &batch_params);
if (err < 0) {
DHD_ERROR(("failed to configure batch scan\n"));
+ } else {
+ memset(command, 0, total_len);
+ err = sprintf(command, "%d", err);
}
} else if (!strncmp(pos, PNO_BATCHING_GET, strlen(PNO_BATCHING_GET))) {
err = dhd_dev_pno_get_for_batch(dev, command, total_len);
@@ -384,6 +387,9 @@ wls_parse_batching_cmd(struct net_device *dev, char *command, int total_len)
err = dhd_dev_pno_stop_for_batch(dev);
if (err < 0) {
DHD_ERROR(("failed to stop batching scan\n"));
+ } else {
+ memset(command, 0, total_len);
+ err = sprintf(command, "OK");
}
} else {
DHD_ERROR(("%s : unknown command\n", __FUNCTION__));