Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 314241
b: refs/heads/master
c: 658f37b
h: refs/heads/master
i:
  314239: af1c118
v: v3
  • Loading branch information
Amitkumar Karwar authored and John W. Linville committed Jun 11, 2012
1 parent 4ab1bba commit 03caec8
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 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: 3249ba7376caa93af387d8e6b5e41b290934f88c
refs/heads/master: 658f37b736ce335edcdf1425228e8652ec6adf24
34 changes: 27 additions & 7 deletions trunk/drivers/net/wireless/mwifiex/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
/* The maximum number of channels the firmware can scan per command */
#define MWIFIEX_MAX_CHANNELS_PER_SPECIFIC_SCAN 14

#define MWIFIEX_CHANNELS_PER_SCAN_CMD 4
#define MWIFIEX_DEF_CHANNELS_PER_SCAN_CMD 4
#define MWIFIEX_LIMIT_1_CHANNEL_PER_SCAN_CMD 15
#define MWIFIEX_LIMIT_2_CHANNELS_PER_SCAN_CMD 27
#define MWIFIEX_LIMIT_3_CHANNELS_PER_SCAN_CMD 35

/* Memory needed to store a max sized Channel List TLV for a firmware scan */
#define CHAN_TLV_MAX_SIZE (sizeof(struct mwifiex_ie_types_header) \
Expand Down Expand Up @@ -471,7 +474,7 @@ mwifiex_is_network_compatible(struct mwifiex_private *priv,
* This routine is used for any scan that is not provided with a
* specific channel list to scan.
*/
static void
static int
mwifiex_scan_create_channel_list(struct mwifiex_private *priv,
const struct mwifiex_user_scan_cfg
*user_scan_in,
Expand Down Expand Up @@ -528,6 +531,7 @@ mwifiex_scan_create_channel_list(struct mwifiex_private *priv,
}

}
return chan_idx;
}

/*
Expand Down Expand Up @@ -727,6 +731,7 @@ mwifiex_config_scan(struct mwifiex_private *priv,
u32 num_probes;
u32 ssid_len;
u32 chan_idx;
u32 chan_num;
u32 scan_type;
u16 scan_dur;
u8 channel;
Expand Down Expand Up @@ -850,7 +855,7 @@ mwifiex_config_scan(struct mwifiex_private *priv,
if (*filtered_scan)
*max_chan_per_scan = MWIFIEX_MAX_CHANNELS_PER_SPECIFIC_SCAN;
else
*max_chan_per_scan = MWIFIEX_CHANNELS_PER_SCAN_CMD;
*max_chan_per_scan = MWIFIEX_DEF_CHANNELS_PER_SCAN_CMD;

/* If the input config or adapter has the number of Probes set,
add tlv */
Expand Down Expand Up @@ -962,13 +967,28 @@ mwifiex_config_scan(struct mwifiex_private *priv,
dev_dbg(adapter->dev,
"info: Scan: Scanning current channel only\n");
}

chan_num = chan_idx;
} else {
dev_dbg(adapter->dev,
"info: Scan: Creating full region channel list\n");
mwifiex_scan_create_channel_list(priv, user_scan_in,
scan_chan_list,
*filtered_scan);
chan_num = mwifiex_scan_create_channel_list(priv, user_scan_in,
scan_chan_list,
*filtered_scan);
}

/*
* In associated state we will reduce the number of channels scanned per
* scan command to avoid any traffic delay/loss. This number is decided
* based on total number of channels to be scanned due to constraints
* of command buffers.
*/
if (priv->media_connected) {
if (chan_num < MWIFIEX_LIMIT_1_CHANNEL_PER_SCAN_CMD)
*max_chan_per_scan = 1;
else if (chan_num < MWIFIEX_LIMIT_2_CHANNELS_PER_SCAN_CMD)
*max_chan_per_scan = 2;
else if (chan_num < MWIFIEX_LIMIT_3_CHANNELS_PER_SCAN_CMD)
*max_chan_per_scan = 3;
}
}

Expand Down

0 comments on commit 03caec8

Please sign in to comment.