162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
262306a36Sopenharmony_ci/****************************************************************************
362306a36Sopenharmony_ci * Driver for Solarflare network controllers and boards
462306a36Sopenharmony_ci * Copyright 2018 Solarflare Communications Inc.
562306a36Sopenharmony_ci *
662306a36Sopenharmony_ci * This program is free software; you can redistribute it and/or modify it
762306a36Sopenharmony_ci * under the terms of the GNU General Public License version 2 as published
862306a36Sopenharmony_ci * by the Free Software Foundation, incorporated herein by reference.
962306a36Sopenharmony_ci */
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci#ifndef EFX_TX_COMMON_H
1262306a36Sopenharmony_ci#define EFX_TX_COMMON_H
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ciint efx_siena_probe_tx_queue(struct efx_tx_queue *tx_queue);
1562306a36Sopenharmony_civoid efx_siena_init_tx_queue(struct efx_tx_queue *tx_queue);
1662306a36Sopenharmony_civoid efx_siena_fini_tx_queue(struct efx_tx_queue *tx_queue);
1762306a36Sopenharmony_civoid efx_siena_remove_tx_queue(struct efx_tx_queue *tx_queue);
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_cistatic inline bool efx_tx_buffer_in_use(struct efx_tx_buffer *buffer)
2062306a36Sopenharmony_ci{
2162306a36Sopenharmony_ci	return buffer->len || (buffer->flags & EFX_TX_BUF_OPTION);
2262306a36Sopenharmony_ci}
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_civoid efx_siena_xmit_done_check_empty(struct efx_tx_queue *tx_queue);
2562306a36Sopenharmony_civoid efx_siena_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index);
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_civoid efx_siena_enqueue_unwind(struct efx_tx_queue *tx_queue,
2862306a36Sopenharmony_ci			      unsigned int insert_count);
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_cistruct efx_tx_buffer *efx_siena_tx_map_chunk(struct efx_tx_queue *tx_queue,
3162306a36Sopenharmony_ci					     dma_addr_t dma_addr, size_t len);
3262306a36Sopenharmony_ciint efx_siena_tx_map_data(struct efx_tx_queue *tx_queue, struct sk_buff *skb,
3362306a36Sopenharmony_ci			  unsigned int segment_count);
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ciunsigned int efx_siena_tx_max_skb_descs(struct efx_nic *efx);
3662306a36Sopenharmony_ciint efx_siena_tx_tso_fallback(struct efx_tx_queue *tx_queue, struct sk_buff *skb);
3762306a36Sopenharmony_ci
3862306a36Sopenharmony_ciextern bool efx_siena_separate_tx_channels;
3962306a36Sopenharmony_ci#endif
40