Commit fd2841c5 authored by John W. Linville's avatar John W. Linville
Browse files
parents 0af5491c 0ff1bd35
Loading
Loading
Loading
Loading
+38 −2
Original line number Diff line number Diff line
@@ -190,6 +190,44 @@ enum {
	REPLY_MAX = 0xff
};

/*
 * Minimum number of queues. MAX_NUM is defined in hw specific files.
 * Set the minimum to accommodate
 *  - 4 standard TX queues
 *  - the command queue
 *  - 4 PAN TX queues
 *  - the PAN multicast queue, and
 *  - the AUX (TX during scan dwell) queue.
 */
#define IWL_MIN_NUM_QUEUES	11

/*
 * Command queue depends on iPAN support.
 */
#define IWL_DEFAULT_CMD_QUEUE_NUM	4
#define IWL_IPAN_CMD_QUEUE_NUM		9

#define IWL_TX_FIFO_BK		0	/* shared */
#define IWL_TX_FIFO_BE		1
#define IWL_TX_FIFO_VI		2	/* shared */
#define IWL_TX_FIFO_VO		3
#define IWL_TX_FIFO_BK_IPAN	IWL_TX_FIFO_BK
#define IWL_TX_FIFO_BE_IPAN	4
#define IWL_TX_FIFO_VI_IPAN	IWL_TX_FIFO_VI
#define IWL_TX_FIFO_VO_IPAN	5
/* re-uses the VO FIFO, uCode will properly flush/schedule */
#define IWL_TX_FIFO_AUX		5
#define IWL_TX_FIFO_UNUSED	255

#define IWLAGN_CMD_FIFO_NUM	7

/*
 * This queue number is required for proper operation
 * because the ucode will stop/start the scheduler as
 * required.
 */
#define IWL_IPAN_MCAST_QUEUE	8

/******************************************************************************
 * (0)
 * Commonly used structures and definitions:
@@ -755,8 +793,6 @@ struct iwl_qosparam_cmd {
#define IWLAGN_BROADCAST_ID	15
#define	IWLAGN_STATION_COUNT	16

#define	IWL_INVALID_STATION 	255
#define IWL_MAX_TID_COUNT	8
#define IWL_TID_NON_QOS IWL_MAX_TID_COUNT

#define STA_FLG_TX_RATE_MSK		cpu_to_le32(1 << 2)
+5 −1
Original line number Diff line number Diff line
@@ -2255,6 +2255,10 @@ static ssize_t iwl_dbgfs_log_event_write(struct file *file,
	char buf[8];
	int buf_size;

	/* check that the interface is up */
	if (!iwl_is_ready(priv))
		return -EAGAIN;

	memset(buf, 0, sizeof(buf));
	buf_size = min(count, sizeof(buf) -  1);
	if (copy_from_user(buf, user_buf, buf_size))
+0 −16
Original line number Diff line number Diff line
@@ -90,22 +90,6 @@

#define IWL_NUM_SCAN_RATES         (2)

/*
 * Minimum number of queues. MAX_NUM is defined in hw specific files.
 * Set the minimum to accommodate
 *  - 4 standard TX queues
 *  - the command queue
 *  - 4 PAN TX queues
 *  - the PAN multicast queue, and
 *  - the AUX (TX during scan dwell) queue.
 */
#define IWL_MIN_NUM_QUEUES	11

/*
 * Command queue depends on iPAN support.
 */
#define IWL_DEFAULT_CMD_QUEUE_NUM	4
#define IWL_IPAN_CMD_QUEUE_NUM		9

#define IEEE80211_DATA_LEN              2304
#define IEEE80211_4ADDR_LEN             30
+1 −55
Original line number Diff line number Diff line
@@ -518,49 +518,6 @@ static void iwl_bg_tx_flush(struct work_struct *work)
 * queue/FIFO/AC mapping definitions
 */

#define IWL_TX_FIFO_BK		0	/* shared */
#define IWL_TX_FIFO_BE		1
#define IWL_TX_FIFO_VI		2	/* shared */
#define IWL_TX_FIFO_VO		3
#define IWL_TX_FIFO_BK_IPAN	IWL_TX_FIFO_BK
#define IWL_TX_FIFO_BE_IPAN	4
#define IWL_TX_FIFO_VI_IPAN	IWL_TX_FIFO_VI
#define IWL_TX_FIFO_VO_IPAN	5
/* re-uses the VO FIFO, uCode will properly flush/schedule */
#define IWL_TX_FIFO_AUX		5
#define IWL_TX_FIFO_UNUSED	-1

#define IWLAGN_CMD_FIFO_NUM	7

/*
 * This queue number is required for proper operation
 * because the ucode will stop/start the scheduler as
 * required.
 */
#define IWL_IPAN_MCAST_QUEUE	8

static const u8 iwlagn_default_queue_to_tx_fifo[] = {
	IWL_TX_FIFO_VO,
	IWL_TX_FIFO_VI,
	IWL_TX_FIFO_BE,
	IWL_TX_FIFO_BK,
	IWLAGN_CMD_FIFO_NUM,
};

static const u8 iwlagn_ipan_queue_to_tx_fifo[] = {
	IWL_TX_FIFO_VO,
	IWL_TX_FIFO_VI,
	IWL_TX_FIFO_BE,
	IWL_TX_FIFO_BK,
	IWL_TX_FIFO_BK_IPAN,
	IWL_TX_FIFO_BE_IPAN,
	IWL_TX_FIFO_VI_IPAN,
	IWL_TX_FIFO_VO_IPAN,
	IWL_TX_FIFO_BE_IPAN,
	IWLAGN_CMD_FIFO_NUM,
	IWL_TX_FIFO_AUX,
};

static const u8 iwlagn_bss_ac_to_fifo[] = {
	IWL_TX_FIFO_VO,
	IWL_TX_FIFO_VI,
@@ -1350,6 +1307,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
	else
		trans_cfg.queue_watchdog_timeout = IWL_WATCHDOG_DISABLED;
	trans_cfg.command_names = iwl_dvm_cmd_strings;
	trans_cfg.cmd_fifo = IWLAGN_CMD_FIFO_NUM;

	WARN_ON(sizeof(priv->transport_queue_stop) * BITS_PER_BYTE <
		priv->cfg->base_params->num_of_queues);
@@ -1363,15 +1321,9 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
	if (ucode_flags & IWL_UCODE_TLV_FLAGS_PAN) {
		priv->sta_key_max_num = STA_KEY_MAX_NUM_PAN;
		trans_cfg.cmd_queue = IWL_IPAN_CMD_QUEUE_NUM;
		trans_cfg.queue_to_fifo = iwlagn_ipan_queue_to_tx_fifo;
		trans_cfg.n_queue_to_fifo =
			ARRAY_SIZE(iwlagn_ipan_queue_to_tx_fifo);
	} else {
		priv->sta_key_max_num = STA_KEY_MAX_NUM;
		trans_cfg.cmd_queue = IWL_DEFAULT_CMD_QUEUE_NUM;
		trans_cfg.queue_to_fifo = iwlagn_default_queue_to_tx_fifo;
		trans_cfg.n_queue_to_fifo =
			ARRAY_SIZE(iwlagn_default_queue_to_tx_fifo);
	}

	/* Configure transport layer */
@@ -1460,9 +1412,6 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
		ucode_flags &= ~IWL_UCODE_TLV_FLAGS_P2P;
		priv->sta_key_max_num = STA_KEY_MAX_NUM;
		trans_cfg.cmd_queue = IWL_DEFAULT_CMD_QUEUE_NUM;
		trans_cfg.queue_to_fifo = iwlagn_default_queue_to_tx_fifo;
		trans_cfg.n_queue_to_fifo =
			ARRAY_SIZE(iwlagn_default_queue_to_tx_fifo);

		/* Configure transport layer again*/
		iwl_trans_configure(priv->trans, &trans_cfg);
@@ -1480,9 +1429,6 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
		atomic_set(&priv->queue_stop_count[i], 0);
	}

	WARN_ON(trans_cfg.queue_to_fifo[trans_cfg.cmd_queue] !=
						IWLAGN_CMD_FIFO_NUM);

	if (iwl_init_drv(priv))
		goto out_free_eeprom;

+27 −10
Original line number Diff line number Diff line
@@ -396,15 +396,21 @@ static u16 iwl_get_active_dwell_time(struct iwl_priv *priv,
static u16 iwl_limit_dwell(struct iwl_priv *priv, u16 dwell_time)
{
	struct iwl_rxon_context *ctx;
	int limits[NUM_IWL_RXON_CTX] = {};
	int n_active = 0;
	u16 limit;

	BUILD_BUG_ON(NUM_IWL_RXON_CTX != 2);

	/*
	 * If we're associated, we clamp the dwell time 98%
	 * of the smallest beacon interval (minus 2 * channel
	 * tune time)
	 * of the beacon interval (minus 2 * channel tune time)
	 * If both contexts are active, we have to restrict to
	 * 1/2 of the minimum of them, because they might be in
	 * lock-step with the time inbetween only half of what
	 * time we'd have in each of them.
	 */
	for_each_context(priv, ctx) {
		u16 value;

		switch (ctx->staging.dev_type) {
		case RXON_DEV_TYPE_P2P:
			/* no timing constraints */
@@ -424,14 +430,25 @@ static u16 iwl_limit_dwell(struct iwl_priv *priv, u16 dwell_time)
			break;
		}

		value = ctx->beacon_int;
		if (!value)
			value = IWL_PASSIVE_DWELL_BASE;
		value = (value * 98) / 100 - IWL_CHANNEL_TUNE_TIME * 2;
		dwell_time = min(value, dwell_time);
		limits[n_active++] = ctx->beacon_int ?: IWL_PASSIVE_DWELL_BASE;
	}

	switch (n_active) {
	case 0:
		return dwell_time;
	case 2:
		limit = (limits[1] * 98) / 100 - IWL_CHANNEL_TUNE_TIME * 2;
		limit /= 2;
		dwell_time = min(limit, dwell_time);
		/* fall through to limit further */
	case 1:
		limit = (limits[0] * 98) / 100 - IWL_CHANNEL_TUNE_TIME * 2;
		limit /= n_active;
		return min(limit, dwell_time);
	default:
		WARN_ON_ONCE(1);
		return dwell_time;
	}
}

static u16 iwl_get_passive_dwell_time(struct iwl_priv *priv,
Loading