Lines Matching refs:in

4  * you may not use this file except in compliance with the License.
9 * Unless required by applicable law or agreed to in writing, software
29 * QEMU virtio-tablet coordinates sit in a fixed square:
110 static void PopulateEventQ(const struct Virtin *in)
112 const struct Virtq *q = &in->dev.vq[0];
116 q->desc[i].pAddr = VMM_TO_DMA_ADDR((VADDR_T)&in->ev[i]);
123 in->dev.vq[0].avail->index += in->dev.vq[0].qsz;
124 OSAL_WRITEL(0, in->dev.base + VIRTMMIO_REG_QUEUENOTIFY);
142 static void VirtinHandleEv(struct Virtin *in)
144 struct Virtq *q = &in->dev.vq[0];
154 if (HdfWorkInit(&w, VirtinWorkCallback, &in->ev[idx]) == HDF_SUCCESS) {
155 (void)HdfAddWork(&in->wq, &w); /* HDF will alloc for 'realwork' */
166 OSAL_WRITEL(0, in->dev.base + VIRTMMIO_REG_QUEUENOTIFY);
173 struct Virtin *in = dev;
175 if (!(OSAL_READL(in->dev.base + VIRTMMIO_REG_INTERRUPTSTATUS) & VIRTMMIO_IRQ_NOTIFY_USED)) {
179 VirtinHandleEv(in);
181 OSAL_WRITEL(VIRTMMIO_IRQ_NOTIFY_USED, in->dev.base + VIRTMMIO_REG_INTERRUPTACK);
257 static void VirtinFillHidInfo(const struct Virtin *in, HidInfo *devInfo)
259 struct VirtinConfig *conf = (struct VirtinConfig *)(in->dev.base + VIRTMMIO_REG_CONFIG);
266 before = OSAL_READL(in->dev.base + VIRTMMIO_REG_CONFIGGENERATION);
272 after = OSAL_READL(in->dev.base + VIRTMMIO_REG_CONFIGGENERATION);
276 static int32_t HdfVirtinInitHid(struct Virtin *in)
286 VirtinFillHidInfo(in, devInfo);
299 static void VirtinDeInit(struct Virtin *in)
301 if (in->dev.irq & ~_IRQ_MASK) {
302 OsalUnregisterIrq(in->dev.irq & _IRQ_MASK, in);
304 LOS_DmaMemFree(in);
309 struct Virtin *in = NULL;
315 in = LOS_DmaMemAlloc(NULL, len, sizeof(void *), DMA_CACHE);
316 if (in == NULL) {
321 if (!VirtmmioDiscover(VIRTMMIO_DEVICE_ID_INPUT, &in->dev)) {
325 VirtmmioInitBegin(&in->dev);
327 if (!VirtmmioNegotiate(&in->dev, Feature0, Feature1, in)) {
331 base = ALIGN((VADDR_T)in + sizeof(struct Virtin), VIRTQ_ALIGN_DESC);
334 if (VirtmmioConfigQueue(&in->dev, base, qsz, VIRTQ_NUM) == 0) {
338 ret = OsalRegisterIrq(in->dev.irq, OSAL_IRQF_TRIGGER_NONE, (OsalIRQHandle)VirtinIRQhandle,
339 VIRTMMIO_INPUT_NAME, in);
344 in->dev.irq |= ~_IRQ_MASK;
346 return in;
349 VirtmmioInitFailed(&in->dev);
351 VirtinDeInit(in);
357 struct Virtin *in = NULL;
365 if ((in = VirtinInitDev()) == NULL) {
368 device->priv = in;
370 if ((ret = HdfVirtinInitHid(in)) != HDF_SUCCESS) {
374 if ((ret = HdfWorkQueueInit(&in->wq, VIRTMMIO_INPUT_NAME)) != HDF_SUCCESS) {
378 PopulateEventQ(in);
379 VritmmioInitEnd(&in->dev); /* now virt queue can be used */
389 struct Virtin *in = deviceObject->priv;
390 if (in == NULL) {
394 if (in->wq.realWorkQueue) {
395 HdfWorkQueueDestroy(&in->wq);
400 VirtinDeInit(in);