if (doorbell)
val |= USE_DB_ENG_FMASK;
- if (!channel->use_prefetch)
+ /* Starting with IPA v4.0 the command channel uses the escape buffer */
+ if (gsi->version != IPA_VERSION_3_5_1 && channel->command)
val |= USE_ESCAPE_BUF_ONLY_FMASK;
iowrite32(val, gsi->virt + GSI_CH_C_QOS_OFFSET(channel_id));
/* Init function for a single channel */
static int gsi_channel_init_one(struct gsi *gsi,
const struct ipa_gsi_endpoint_data *data,
- bool command, bool prefetch)
+ bool command)
{
struct gsi_channel *channel;
u32 tre_count;
channel->gsi = gsi;
channel->toward_ipa = data->toward_ipa;
channel->command = command;
- channel->use_prefetch = command && prefetch;
channel->tlv_count = data->channel.tlv_count;
channel->tre_count = tre_count;
channel->event_count = data->channel.event_count;
}
/* Init function for channels */
-static int gsi_channel_init(struct gsi *gsi, bool prefetch, u32 count,
+static int gsi_channel_init(struct gsi *gsi, u32 count,
const struct ipa_gsi_endpoint_data *data,
bool modem_alloc)
{
continue;
}
- ret = gsi_channel_init_one(gsi, &data[i], command, prefetch);
+ ret = gsi_channel_init_one(gsi, &data[i], command);
if (ret)
goto err_unwind;
}
resource_size_t size;
unsigned int irq;
bool modem_alloc;
- bool prefetch;
int ret;
gsi_validate_build();
- /* IPA v4.0+ (GSI v2.0+) uses prefetch for the command channel */
- prefetch = version != IPA_VERSION_3_5_1;
/* IPA v4.2 requires the AP to allocate channels for the modem */
modem_alloc = version == IPA_VERSION_4_2;
gsi->dev = dev;
+ gsi->version = version;
/* The GSI layer performs NAPI on all endpoints. NAPI requires a
* network device structure, but the GSI layer does not have one,
goto err_free_irq;
}
- ret = gsi_channel_init(gsi, prefetch, count, data, modem_alloc);
+ ret = gsi_channel_init(gsi, count, data, modem_alloc);
if (ret)
goto err_iounmap;
#include <linux/platform_device.h>
#include <linux/netdevice.h>
+#include "ipa_version.h"
+
/* Maximum number of channels and event rings supported by the driver */
#define GSI_CHANNEL_COUNT_MAX 17
#define GSI_EVT_RING_COUNT_MAX 13
/* Maximum TLV FIFO size for a channel; 64 here is arbitrary (and high) */
#define GSI_TLV_MAX 64
-enum ipa_version;
-
struct device;
struct scatterlist;
struct platform_device;
struct gsi *gsi;
bool toward_ipa;
bool command; /* AP command TX channel or not */
- bool use_prefetch; /* use prefetch (else escape buf) */
u8 tlv_count; /* # entries in TLV FIFO */
u16 tre_count;
struct gsi {
struct device *dev; /* Same as IPA device */
+ enum ipa_version version;
struct net_device dummy_dev; /* needed for NAPI */
void __iomem *virt;
u32 irq;