Lines Matching refs:channel
230 struct efx_channel *channel; member
424 int channel; member
482 static inline void efx_channel_init_lock(struct efx_channel *channel) in efx_channel_init_lock() argument
484 spin_lock_init(&channel->state_lock); in efx_channel_init_lock()
488 static inline bool efx_channel_lock_napi(struct efx_channel *channel) in efx_channel_lock_napi() argument
492 spin_lock_bh(&channel->state_lock); in efx_channel_lock_napi()
493 if (channel->state & EFX_CHANNEL_LOCKED) { in efx_channel_lock_napi()
494 WARN_ON(channel->state & EFX_CHANNEL_STATE_NAPI); in efx_channel_lock_napi()
495 channel->state |= EFX_CHANNEL_STATE_NAPI_YIELD; in efx_channel_lock_napi()
499 channel->state = EFX_CHANNEL_STATE_NAPI; in efx_channel_lock_napi()
501 spin_unlock_bh(&channel->state_lock); in efx_channel_lock_napi()
505 static inline void efx_channel_unlock_napi(struct efx_channel *channel) in efx_channel_unlock_napi() argument
507 spin_lock_bh(&channel->state_lock); in efx_channel_unlock_napi()
508 WARN_ON(channel->state & in efx_channel_unlock_napi()
511 channel->state &= EFX_CHANNEL_STATE_DISABLED; in efx_channel_unlock_napi()
512 spin_unlock_bh(&channel->state_lock); in efx_channel_unlock_napi()
516 static inline bool efx_channel_lock_poll(struct efx_channel *channel) in efx_channel_lock_poll() argument
520 spin_lock_bh(&channel->state_lock); in efx_channel_lock_poll()
521 if ((channel->state & EFX_CHANNEL_LOCKED)) { in efx_channel_lock_poll()
522 channel->state |= EFX_CHANNEL_STATE_POLL_YIELD; in efx_channel_lock_poll()
526 channel->state |= EFX_CHANNEL_STATE_POLL; in efx_channel_lock_poll()
528 spin_unlock_bh(&channel->state_lock); in efx_channel_lock_poll()
533 static inline void efx_channel_unlock_poll(struct efx_channel *channel) in efx_channel_unlock_poll() argument
535 spin_lock_bh(&channel->state_lock); in efx_channel_unlock_poll()
536 WARN_ON(channel->state & EFX_CHANNEL_STATE_NAPI); in efx_channel_unlock_poll()
539 channel->state &= EFX_CHANNEL_STATE_DISABLED; in efx_channel_unlock_poll()
540 spin_unlock_bh(&channel->state_lock); in efx_channel_unlock_poll()
544 static inline bool efx_channel_busy_polling(struct efx_channel *channel) in efx_channel_busy_polling() argument
546 WARN_ON(!(channel->state & EFX_CHANNEL_OWNED)); in efx_channel_busy_polling()
547 return channel->state & EFX_CHANNEL_USER_PEND; in efx_channel_busy_polling()
550 static inline void efx_channel_enable(struct efx_channel *channel) in efx_channel_enable() argument
552 spin_lock_bh(&channel->state_lock); in efx_channel_enable()
553 channel->state = EFX_CHANNEL_STATE_IDLE; in efx_channel_enable()
554 spin_unlock_bh(&channel->state_lock); in efx_channel_enable()
558 static inline bool efx_channel_disable(struct efx_channel *channel) in efx_channel_disable() argument
562 spin_lock_bh(&channel->state_lock); in efx_channel_disable()
563 if (channel->state & EFX_CHANNEL_OWNED) in efx_channel_disable()
565 channel->state |= EFX_CHANNEL_STATE_DISABLED; in efx_channel_disable()
566 spin_unlock_bh(&channel->state_lock); in efx_channel_disable()
573 static inline void efx_channel_init_lock(struct efx_channel *channel) in efx_channel_init_lock() argument
577 static inline bool efx_channel_lock_napi(struct efx_channel *channel) in efx_channel_lock_napi() argument
582 static inline void efx_channel_unlock_napi(struct efx_channel *channel) in efx_channel_unlock_napi() argument
586 static inline bool efx_channel_lock_poll(struct efx_channel *channel) in efx_channel_lock_poll() argument
591 static inline void efx_channel_unlock_poll(struct efx_channel *channel) in efx_channel_unlock_poll() argument
595 static inline bool efx_channel_busy_polling(struct efx_channel *channel) in efx_channel_busy_polling() argument
600 static inline void efx_channel_enable(struct efx_channel *channel) in efx_channel_enable() argument
604 static inline bool efx_channel_disable(struct efx_channel *channel) in efx_channel_disable() argument
958 struct efx_channel *channel[EFX_MAX_CHANNELS]; member
1243 bool (*handle_global_event)(struct efx_channel *channel, efx_qword_t *);
1256 void (*push_irq_moderation)(struct efx_channel *channel);
1288 int (*ev_probe)(struct efx_channel *channel);
1289 int (*ev_init)(struct efx_channel *channel);
1290 void (*ev_fini)(struct efx_channel *channel);
1291 void (*ev_remove)(struct efx_channel *channel);
1292 int (*ev_process)(struct efx_channel *channel, int quota);
1293 void (*ev_read_ack)(struct efx_channel *channel);
1294 void (*ev_test_generate)(struct efx_channel *channel);
1372 return efx->channel[index]; in efx_get_channel()
1377 for (_channel = (_efx)->channel[0]; \
1379 _channel = (_channel->channel + 1 < (_efx)->n_channels) ? \
1380 (_efx)->channel[_channel->channel + 1] : NULL)
1384 for (_channel = (_efx)->channel[(_efx)->n_channels - 1]; \
1386 _channel = _channel->channel ? \
1387 (_efx)->channel[_channel->channel - 1] : NULL)
1394 return &efx->channel[efx->tx_channel_offset + index]->tx_queue[type]; in efx_get_tx_queue()
1397 static inline bool efx_channel_has_tx_queues(struct efx_channel *channel) in efx_channel_has_tx_queues() argument
1399 return channel->channel - channel->efx->tx_channel_offset < in efx_channel_has_tx_queues()
1400 channel->efx->n_tx_channels; in efx_channel_has_tx_queues()
1404 efx_channel_get_tx_queue(struct efx_channel *channel, unsigned type) in efx_channel_get_tx_queue() argument
1406 EFX_BUG_ON_PARANOID(!efx_channel_has_tx_queues(channel) || in efx_channel_get_tx_queue()
1408 return &channel->tx_queue[type]; in efx_channel_get_tx_queue()
1436 static inline bool efx_channel_has_rx_queue(struct efx_channel *channel) in efx_channel_has_rx_queue() argument
1438 return channel->rx_queue.core_index >= 0; in efx_channel_has_rx_queue()
1442 efx_channel_get_rx_queue(struct efx_channel *channel) in efx_channel_get_rx_queue() argument
1444 EFX_BUG_ON_PARANOID(!efx_channel_has_rx_queue(channel)); in efx_channel_get_rx_queue()
1445 return &channel->rx_queue; in efx_channel_get_rx_queue()
1465 return efx_rx_queue_channel(rx_queue)->channel; in efx_rx_queue_index()