aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/nic.c
diff options
context:
space:
mode:
authorSteve Hodgson <shodgson@solarflare.com>2010-06-01 07:19:09 -0400
committerDavid S. Miller <davem@davemloft.net>2010-06-02 05:21:07 -0400
commitd730dc527a5abd4717f6320e82cfce54edc882a3 (patch)
treeff9ec087fc5f9a30d992a114b29b42b8cc3f1bf0 /drivers/net/sfc/nic.c
parent901d3fe848d8c34988699592c9f4b98c2ce10a8b (diff)
sfc: Allow DRV_GEN events to be used outside of selftests
Formerly, efx_test_eventq_irq() assumed it was the only user of driver generated events. Allow it to interoperate with other users. We can create more than 16 channels, so align event codes with a multiple of 256 not 16. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/nic.c')
-rw-r--r--drivers/net/sfc/nic.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/net/sfc/nic.c b/drivers/net/sfc/nic.c
index ec0bb80f5ae8..ca9cf1a33803 100644
--- a/drivers/net/sfc/nic.c
+++ b/drivers/net/sfc/nic.c
@@ -79,6 +79,10 @@ MODULE_PARM_DESC(rx_xon_thresh_bytes, "RX fifo XON threshold");
79/* Depth of RX flush request fifo */ 79/* Depth of RX flush request fifo */
80#define EFX_RX_FLUSH_COUNT 4 80#define EFX_RX_FLUSH_COUNT 4
81 81
82/* Magic value for efx_generate_test_event() */
83#define EFX_CHANNEL_MAGIC(_channel) \
84 (0x00010100 + (_channel)->channel)
85
82/************************************************************************** 86/**************************************************************************
83 * 87 *
84 * Solarstorm hardware access 88 * Solarstorm hardware access
@@ -993,8 +997,10 @@ int efx_nic_process_eventq(struct efx_channel *channel, int budget)
993 } 997 }
994 break; 998 break;
995 case FSE_AZ_EV_CODE_DRV_GEN_EV: 999 case FSE_AZ_EV_CODE_DRV_GEN_EV:
996 channel->eventq_magic = EFX_QWORD_FIELD( 1000 if (EFX_QWORD_FIELD(event, FSF_AZ_DRV_GEN_EV_MAGIC)
997 event, FSF_AZ_DRV_GEN_EV_MAGIC); 1001 == EFX_CHANNEL_MAGIC(channel))
1002 ++channel->magic_count;
1003
998 EFX_LOG(channel->efx, "channel %d received generated " 1004 EFX_LOG(channel->efx, "channel %d received generated "
999 "event "EFX_QWORD_FMT"\n", channel->channel, 1005 "event "EFX_QWORD_FMT"\n", channel->channel,
1000 EFX_QWORD_VAL(event)); 1006 EFX_QWORD_VAL(event));
@@ -1088,12 +1094,9 @@ void efx_nic_remove_eventq(struct efx_channel *channel)
1088} 1094}
1089 1095
1090 1096
1091/* Generates a test event on the event queue. A subsequent call to 1097void efx_nic_generate_test_event(struct efx_channel *channel)
1092 * process_eventq() should pick up the event and place the value of
1093 * "magic" into channel->eventq_magic;
1094 */
1095void efx_nic_generate_test_event(struct efx_channel *channel, unsigned int magic)
1096{ 1098{
1099 unsigned int magic = EFX_CHANNEL_MAGIC(channel);
1097 efx_qword_t test_event; 1100 efx_qword_t test_event;
1098 1101
1099 EFX_POPULATE_QWORD_2(test_event, FSF_AZ_EV_CODE, 1102 EFX_POPULATE_QWORD_2(test_event, FSF_AZ_EV_CODE,