aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/efx.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2011-01-12 13:26:56 -0500
committerBen Hutchings <bhutchings@solarflare.com>2011-01-13 17:08:43 -0500
commit976534319b0823aae29237d02e29a32ebcd5f910 (patch)
tree7ded52acd405d90e05fe38aff3592c08be0abda3 /drivers/net/sfc/efx.c
parent5b919f833d9d60588d026ad82d17f17e8872c7a9 (diff)
sfc: Make efx_get_tx_queue() an inline function
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/sfc/efx.c')
-rw-r--r--drivers/net/sfc/efx.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index 711449c6e675..c2dc9a525dea 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -1266,27 +1266,18 @@ static void efx_remove_interrupts(struct efx_nic *efx)
1266 efx->legacy_irq = 0; 1266 efx->legacy_irq = 0;
1267} 1267}
1268 1268
1269struct efx_tx_queue *
1270efx_get_tx_queue(struct efx_nic *efx, unsigned index, unsigned type)
1271{
1272 unsigned tx_channel_offset =
1273 separate_tx_channels ? efx->n_channels - efx->n_tx_channels : 0;
1274 EFX_BUG_ON_PARANOID(index >= efx->n_tx_channels ||
1275 type >= EFX_TXQ_TYPES);
1276 return &efx->channel[tx_channel_offset + index]->tx_queue[type];
1277}
1278
1279static void efx_set_channels(struct efx_nic *efx) 1269static void efx_set_channels(struct efx_nic *efx)
1280{ 1270{
1281 struct efx_channel *channel; 1271 struct efx_channel *channel;
1282 struct efx_tx_queue *tx_queue; 1272 struct efx_tx_queue *tx_queue;
1283 unsigned tx_channel_offset = 1273
1274 efx->tx_channel_offset =
1284 separate_tx_channels ? efx->n_channels - efx->n_tx_channels : 0; 1275 separate_tx_channels ? efx->n_channels - efx->n_tx_channels : 0;
1285 1276
1286 /* Channel pointers were set in efx_init_struct() but we now 1277 /* Channel pointers were set in efx_init_struct() but we now
1287 * need to clear them for TX queues in any RX-only channels. */ 1278 * need to clear them for TX queues in any RX-only channels. */
1288 efx_for_each_channel(channel, efx) { 1279 efx_for_each_channel(channel, efx) {
1289 if (channel->channel - tx_channel_offset >= 1280 if (channel->channel - efx->tx_channel_offset >=
1290 efx->n_tx_channels) { 1281 efx->n_tx_channels) {
1291 efx_for_each_channel_tx_queue(tx_queue, channel) 1282 efx_for_each_channel_tx_queue(tx_queue, channel)
1292 tx_queue->channel = NULL; 1283 tx_queue->channel = NULL;