Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 301047
b: refs/heads/master
c: b5abcf0
h: refs/heads/master
i:
  301045: f88021f
  301043: 685a618
  301039: 83f601c
v: v3
  • Loading branch information
Amitkumar Karwar authored and John W. Linville committed Apr 17, 2012
1 parent b4cb794 commit 936f744
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9558a407dd00f6cd7f93b923768e8ee255fa4444
refs/heads/master: b5abcf0219263f4e961dca71cbe26e06c5b0ee68
4 changes: 2 additions & 2 deletions trunk/drivers/net/wireless/mwifiex/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -1482,8 +1482,8 @@ int mwifiex_register_cfg80211(struct mwifiex_private *priv)
memcpy(wdev->wiphy->perm_addr, priv->curr_addr, ETH_ALEN);
wdev->wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM;

/* Reserve space for bss band information */
wdev->wiphy->bss_priv_size = sizeof(u8);
/* Reserve space for mwifiex specific private data for BSS */
wdev->wiphy->bss_priv_size = sizeof(struct mwifiex_bss_priv);

wdev->wiphy->reg_notifier = mwifiex_reg_notifier;

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/mwifiex/fw.h
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ struct host_cmd_ds_txpwr_cfg {
struct mwifiex_bcn_param {
u8 bssid[ETH_ALEN];
u8 rssi;
__le32 timestamp[2];
__le64 timestamp;
__le16 beacon_period;
__le16 cap_info_bitmap;
} __packed;
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/net/wireless/mwifiex/join.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,15 @@ mwifiex_cmd_append_tsf_tlv(struct mwifiex_private *priv, u8 **buffer,
*buffer += sizeof(tsf_tlv.header);

/* TSF at the time when beacon/probe_response was received */
tsf_val = cpu_to_le64(bss_desc->network_tsf);
tsf_val = cpu_to_le64(bss_desc->fw_tsf);
memcpy(*buffer, &tsf_val, sizeof(tsf_val));
*buffer += sizeof(tsf_val);

memcpy(&tsf_val, bss_desc->time_stamp, sizeof(tsf_val));
tsf_val = cpu_to_le64(bss_desc->timestamp);

dev_dbg(priv->adapter->dev,
"info: %s: TSF offset calc: %016llx - %016llx\n",
__func__, tsf_val, bss_desc->network_tsf);
__func__, bss_desc->timestamp, bss_desc->fw_tsf);

memcpy(*buffer, &tsf_val, sizeof(tsf_val));
*buffer += sizeof(tsf_val);
Expand Down
9 changes: 7 additions & 2 deletions trunk/drivers/net/wireless/mwifiex/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ struct mwifiex_bssdescriptor {
* BAND_A(0X04): 'a' band
*/
u16 bss_band;
u64 network_tsf;
u8 time_stamp[8];
u64 fw_tsf;
u64 timestamp;
union ieee_types_phy_param_set phy_param_set;
union ieee_types_ss_param_set ss_param_set;
u16 cap_info_bitmap;
Expand Down Expand Up @@ -522,6 +522,11 @@ struct cmd_ctrl_node {
u8 cmd_wait_q_woken;
};

struct mwifiex_bss_priv {
u8 band;
u64 fw_tsf;
};

struct mwifiex_if_ops {
int (*init_if) (struct mwifiex_adapter *);
void (*cleanup_if) (struct mwifiex_adapter *);
Expand Down
22 changes: 13 additions & 9 deletions trunk/drivers/net/wireless/mwifiex/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1603,14 +1603,16 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
const u8 *ie_buf;
size_t ie_len;
u16 channel = 0;
u64 network_tsf = 0;
u64 fw_tsf = 0;
u16 beacon_size = 0;
u32 curr_bcn_bytes;
u32 freq;
u16 beacon_period;
u16 cap_info_bitmap;
u8 *current_ptr;
u64 timestamp;
struct mwifiex_bcn_param *bcn_param;
struct mwifiex_bss_priv *bss_priv;

if (bytes_left >= sizeof(beacon_size)) {
/* Extract & convert beacon size from command buffer */
Expand Down Expand Up @@ -1654,6 +1656,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
rssi = (-rssi) * 100; /* Convert dBm to mBm */
dev_dbg(adapter->dev, "info: InterpretIE: RSSI=%d\n", rssi);

timestamp = le64_to_cpu(bcn_param->timestamp);
beacon_period = le16_to_cpu(bcn_param->beacon_period);

cap_info_bitmap = le16_to_cpu(bcn_param->cap_info_bitmap);
Expand Down Expand Up @@ -1693,14 +1696,13 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,

/*
* If the TSF TLV was appended to the scan results, save this
* entry's TSF value in the networkTSF field.The networkTSF is
* the firmware's TSF value at the time the beacon or probe
* response was received.
* entry's TSF value in the fw_tsf field. It is the firmware's
* TSF value at the time the beacon or probe response was
* received.
*/
if (tsf_tlv)
memcpy(&network_tsf,
&tsf_tlv->tsf_data[idx * TSF_DATA_SIZE],
sizeof(network_tsf));
memcpy(&fw_tsf, &tsf_tlv->tsf_data[idx * TSF_DATA_SIZE],
sizeof(fw_tsf));

if (channel) {
struct ieee80211_channel *chan;
Expand All @@ -1723,10 +1725,12 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,

if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) {
bss = cfg80211_inform_bss(priv->wdev->wiphy,
chan, bssid, network_tsf,
chan, bssid, timestamp,
cap_info_bitmap, beacon_period,
ie_buf, ie_len, rssi, GFP_KERNEL);
*(u8 *)bss->priv = band;
bss_priv = (struct mwifiex_bss_priv *)bss->priv;
bss_priv->band = band;
bss_priv->fw_tsf = fw_tsf;
if (priv->media_connected &&
!memcmp(bssid,
priv->curr_bss_params.bss_descriptor
Expand Down
5 changes: 4 additions & 1 deletion trunk/drivers/net/wireless/mwifiex/sta_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ int mwifiex_fill_new_bss_desc(struct mwifiex_private *priv,
{
int ret;
u8 *beacon_ie;
struct mwifiex_bss_priv *bss_priv = (void *)bss->priv;

beacon_ie = kmemdup(bss->information_elements, bss->len_beacon_ies,
GFP_KERNEL);
Expand All @@ -174,7 +175,9 @@ int mwifiex_fill_new_bss_desc(struct mwifiex_private *priv,
bss_desc->beacon_buf_size = bss->len_beacon_ies;
bss_desc->beacon_period = bss->beacon_interval;
bss_desc->cap_info_bitmap = bss->capability;
bss_desc->bss_band = *(u8 *)bss->priv;
bss_desc->bss_band = bss_priv->band;
bss_desc->fw_tsf = bss_priv->fw_tsf;
bss_desc->timestamp = bss->tsf;
if (bss_desc->cap_info_bitmap & WLAN_CAPABILITY_PRIVACY) {
dev_dbg(priv->adapter->dev, "info: InterpretIE: AP WEP enabled\n");
bss_desc->privacy = MWIFIEX_802_11_PRIV_FILTER_8021X_WEP;
Expand Down

0 comments on commit 936f744

Please sign in to comment.