当前位置: 首页>>代码示例>>C++>>正文


C++ IRQ_RETVAL函数代码示例

本文整理汇总了C++中IRQ_RETVAL函数的典型用法代码示例。如果您正苦于以下问题:C++ IRQ_RETVAL函数的具体用法?C++ IRQ_RETVAL怎么用?C++ IRQ_RETVAL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了IRQ_RETVAL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: yam_interrupt

static irqreturn_t yam_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
	struct net_device *dev;
	struct yam_port *yp;
	unsigned char iir;
	int counter = 100;
	int i;
	int handled = 0;

	for (i = 0; i < NR_PORTS; i++) {
		dev = yam_devs[i];
		yp = dev->priv;

		if (!netif_running(dev))
			continue;

		while ((iir = IIR_MASK & inb(IIR(dev->base_addr))) != IIR_NOPEND) {
			unsigned char msr = inb(MSR(dev->base_addr));
			unsigned char lsr = inb(LSR(dev->base_addr));
			unsigned char rxb;

			handled = 1;

			if (lsr & LSR_OE)
				++yp->stats.rx_fifo_errors;

			yp->dcd = (msr & RX_DCD) ? 1 : 0;

			if (--counter <= 0) {
				printk(KERN_ERR "%s: too many irq iir=%d\n",
						dev->name, iir);
				goto out;
			}
			if (msr & TX_RDY) {
				++yp->nb_mdint;
				yam_tx_byte(dev, yp);
			}
			if (lsr & LSR_RXC) {
				++yp->nb_rxint;
				rxb = inb(RBR(dev->base_addr));
				if (msr & RX_FLAG)
					yam_rx_flag(dev, yp);
				else
					yam_rx_byte(dev, yp, rxb);
			}
		}
	}
out:
	return IRQ_RETVAL(handled);
}
开发者ID:Antonio-Zhou,项目名称:Linux-2.6.11,代码行数:50,代码来源:yam.c

示例2: rtl8169_interrupt

/* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */
static irqreturn_t
rtl8169_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
{
    struct net_device *dev = (struct net_device *) dev_instance;
    struct rtl8169_private *tp = dev->priv;
    int boguscnt = max_interrupt_work;
    void *ioaddr = tp->mmio_addr;
    int status = 0;
    int handled = 0;

    do {
        status = RTL_R16(IntrStatus);

        /* hotplug/major error/no more work/shared irq */
        if ((status == 0xFFFF) || !status)
            break;

        handled = 1;
        /*
        		if (status & RxUnderrun)
        			link_changed = RTL_R16 (CSCR) & CSCR_LinkChangeBit;
        */
        RTL_W16(IntrStatus,
                (status & RxFIFOOver) ? (status | RxOverflow) : status);

        if (!(status & rtl8169_intr_mask))
            break;

        // Rx interrupt
        if (status & (RxOK | RxUnderrun | RxOverflow | RxFIFOOver)) {
            rtl8169_rx_interrupt(dev, tp, ioaddr);
        }
        // Tx interrupt
        if (status & (TxOK | TxErr)) {
            spin_lock(&tp->lock);
            rtl8169_tx_interrupt(dev, tp, ioaddr);
            spin_unlock(&tp->lock);
        }

        boguscnt--;
    } while (boguscnt > 0);

    if (boguscnt <= 0) {
        printk(KERN_WARNING "%s: Too much work at interrupt!\n",
               dev->name);
        /* Clear all interrupt sources. */
        RTL_W16(IntrStatus, 0xffff);
    }
    return IRQ_RETVAL(handled);
}
开发者ID:wxlong,项目名称:Test,代码行数:51,代码来源:r8169.c

示例3: pci1742_interrupt_handler

irqreturn_t pci1742_interrupt_handler(int irq, void *dev_id)
#endif
{
    private_data *privdata = (private_data *) dev_id;
    INT16U tmp;


    /* 	printk("isr!\n"); */
    /* 	mdelay(1000); */

    tmp = advInp(privdata, 0x07) & 0x08;
    if (tmp) { /* interrupt from A/D or FIFO */
        /* 		KdPrint("isr!\n"); */

        if (privdata->fifo_enable) {
            pci1742_fifo_isr(privdata);
        } else {
            pci1742_nofifo_isr(privdata);
        }

        /* clear interrupt */
        advOutp(privdata, 0x08, 0x00);
        /* advOutp(privdata, 0x09, 0x00); */
    } else { /* interrupt from PCI9054 */
        tmp = advInp(privdata, 0x6a) & 0x20;
        if (tmp != 0x20) {
            return IRQ_RETVAL(0);
        }

        pci1742_dma_isr(privdata);

        /* clear DMA interrupt */
        /* advOutpDMA(privdata, 0xa8, advInpDMA(privdata, 0xa8) | 0x08); */
    }

    return IRQ_RETVAL(1);
}
开发者ID:rct225,项目名称:scanside,代码行数:37,代码来源:advisr.c

示例4: nv_do_interrupt

static irqreturn_t nv_do_interrupt(struct ata_host_set *host_set, u8 irq_stat)
{
	int i, handled = 0;

	for (i = 0; i < host_set->n_ports; i++) {
		struct ata_port *ap = host_set->ports[i];

		if (ap && !(ap->flags & ATA_FLAG_DISABLED))
			handled += nv_host_intr(ap, irq_stat);

		irq_stat >>= NV_INT_PORT_SHIFT;
	}

	return IRQ_RETVAL(handled);
}
开发者ID:FatSunHYS,项目名称:OSCourseDesign,代码行数:15,代码来源:sata_nv.c

示例5: buttons_interrupt

/*按键中断处理函数*/
static irqreturn_t buttons_interrupt(int irq, void *dev_id)
{
	int i;
	for(i=0; i<6; i++){
		if(irq == button_irqs[i]){
			//printk("==>interrput number:%d\n",irq);
			key_value = i;
			ev_press =1;
			wake_up_interruptible(&button_waitq);
		}
	}

	return IRQ_RETVAL(IRQ_HANDLED);

}
开发者ID:xf739645524,项目名称:ok6410-drivers,代码行数:16,代码来源:plat_btn_driver.c

示例6: buttons_interrupt

static irqreturn_t buttons_interrupt(int irq, void *dev_id)
{
	struct button_irq_desc *button_irq = (struct button_irq_desc *)dev_id;
	int down;

	down = !s3c2410_gpio_getpin(button_irq->pin);
	if (down != (key_values[button_irq->number] & 1)) {
		/* printk(KERN_ALERT "key_values[button_irq->number] & 1 = %d\n", key_values[button_irq->number] & 1); */
		key_values[button_irq->number] = '0' + down;
		ev_press = 1;
		wake_up_interruptible(&button_waitq);
	}	

	return IRQ_RETVAL(IRQ_HANDLED);
}
开发者ID:jiankangshiye,项目名称:onedriveroneweek,代码行数:15,代码来源:keys.c

示例7: pb1200_cascade_handler

irqreturn_t pb1200_cascade_handler( int irq, void *dev_id)
{
	unsigned short bisr = bcsr->int_status;
	int extirq_nr = 0;

	/* Clear all the edge interrupts. This has no effect on level */
	bcsr->int_status = bisr;
	for( ; bisr; bisr &= (bisr-1) )
	{
		extirq_nr = (PB1200_INT_BEGIN-1) + au_ffs(bisr);
		/* Ack and dispatch IRQ */
		do_IRQ(extirq_nr);
	}

	return IRQ_RETVAL(1);
}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:16,代码来源:irqmap.c

示例8: imxmci_irq

static irqreturn_t imxmci_irq(int irq, void *devid)
{
	struct imxmci_host *host = devid;
	uint32_t stat = MMC_STATUS;
	int handled = 1;

	MMC_INT_MASK = host->imask | INT_MASK_SDIO | INT_MASK_AUTO_CARD_DETECT;

	atomic_set(&host->stuck_timeout, 0);
	host->status_reg = stat;
	set_bit(IMXMCI_PEND_IRQ_b, &host->pending_events);
	set_bit(IMXMCI_PEND_STARTED_b, &host->pending_events);
	tasklet_schedule(&host->tasklet);

	return IRQ_RETVAL(handled);;
}
开发者ID:ivucica,项目名称:linux,代码行数:16,代码来源:imxmmc.c

示例9: dvfs_irq

static irqreturn_t dvfs_irq(int irq, void *dev_id)
{

	u32 pmcr0 = __raw_readl(MXC_CCM_PMCR0);

	/* Config dvfs_start bit */
	pmcr0 = pmcr0 | MXC_CCM_PMCR0_DVFS_START;
	/*Mask interrupt */
	pmcr0 = pmcr0 | MXC_CCM_PMCR0_FSVAIM;
	__raw_writel(pmcr0, MXC_CCM_PMCR0);

	stored_pmcr0 = pmcr0;
	schedule_delayed_work(&dvfs_work, 0);

	return IRQ_RETVAL(1);
}
开发者ID:twobob,项目名称:KK_kernel,代码行数:16,代码来源:dvfs.c

示例10: altera_uart_interrupt

static irqreturn_t altera_uart_interrupt(int irq, void *data)
{
	struct uart_port *port = data;
	struct altera_uart *pp = container_of(port, struct altera_uart, port);
	unsigned int isr;

	isr = altera_uart_readl(port, ALTERA_UART_STATUS_REG) & pp->imr;

	spin_lock(&port->lock);
	if (isr & ALTERA_UART_STATUS_RRDY_MSK)
		altera_uart_rx_chars(pp);
	if (isr & ALTERA_UART_STATUS_TRDY_MSK)
		altera_uart_tx_chars(pp);
	spin_unlock(&port->lock);

	return IRQ_RETVAL(isr);
}
开发者ID:0xroot,项目名称:Blackphone-BP1-Kernel,代码行数:17,代码来源:altera_uart.c

示例11: sca_intr

static irqreturn_t sca_intr(int irq, void *dev_id)
{
	card_t *card = dev_id;
	u32 isr0 = sca_inl(ISR0, card);
	int i, handled = 0;

	for (i = 0; i < 2; i++) {
		port_t *port = get_port(card, i);
		if (port && (isr0 & (i ? 0x08002200 : 0x00080022))) {
			handled = 1;
			disable_intr(port);
			napi_schedule(&port->napi);
		}
	}

	return IRQ_RETVAL(handled);
}
开发者ID:STS-Dev-Team,项目名称:kernel_mapphone_kexec,代码行数:17,代码来源:hd64572.c

示例12: isp_isr

static irqreturn_t isp_isr(int irq, void *dev_id)
{
	struct isp_t *dev;
	unsigned long flags;

	dev = (struct isp_t *) dev_id;

	spin_lock_irqsave(&dev->lock, flags);
	dev->isp_status.status = reg_read(isp_base, ISP_STATUS_OFFSET);
	spin_unlock_irqrestore(&dev->lock, flags);

	reg_write(isp_base, ISP_STATUS_OFFSET, dev->isp_status.status);

	complete(&dev->irq_sem);

	return IRQ_RETVAL(1);
}
开发者ID:TheNikiz,项目名称:android_kernel_samsung_hawaii,代码行数:17,代码来源:isp.c

示例13: buttons_interrupt

static irqreturn_t buttons_interrupt(int irq, void *dev_id)
{
    //获取当前按键资源的索引
    int key = (int)dev_id;

    if(key_status[key] == KEY_UP)
    {
        //设置当前按键的状态为不确定
        key_status[key] = KEY_UNCERTAIN;

        //设置当前按键按下去抖定时器的延时并启动定时器
        key_timers[key].expires = jiffies + KEY_TIMER_DELAY1;
        add_timer(&key_timers[key]);
    }

    return IRQ_RETVAL(IRQ_HANDLED);
}
开发者ID:cutecheng,项目名称:rounder,代码行数:17,代码来源:button.c

示例14: tiny6410_keys_irq

static irqreturn_t tiny6410_keys_irq(int irq, void *dev_id)
{
    unsigned int tmp;
    irq_dev = (struct key_desc *)dev_id;

    if ((irq_dev->irq == IRQ_EINT(19)) || (irq_dev->irq == IRQ_EINT(20))) {
        tmp = readl(S3C64XX_GPLDAT);
        irq_dev->pin_val = tmp & (1<<irq_dev->pin);
    }else {
        tmp = readl(S3C64XX_GPNDAT);
        irq_dev->pin_val = tmp & (1<<irq_dev->pin);
    }
    
    /* Start the timer after 10ms */
    mod_timer(&keys_timers, jiffies+HZ/100);
    return IRQ_RETVAL(IRQ_HANDLED);
}
开发者ID:uwyyk,项目名称:LINUX_DRIVERS,代码行数:17,代码来源:tiny6410_input_key.c

示例15: sah_Intr_Top_Half

/*!
*******************************************************************************
* This function is the Top Half of the interrupt handler.  It updates the
* status of any finished descriptor chains and then tries to add any pending
* requests into the hardware.  It then queues the bottom half to complete
* operations on the finished chains.
*
* @brief     SAHARA Interrupt Handler Top Half
*
* @param    irq     Part of the kernel prototype.
* @param    dev_id  Part of the kernel prototype.
*
* @return   An IRQ_RETVAL() -- non-zero to that function means 'handled'
*/
static irqreturn_t sah_Intr_Top_Half(int irq, void *dev_id)
{
#if defined(DIAG_DRV_INTERRUPT) && defined(DIAG_DURING_INTERRUPT)
	LOG_KDIAG("Top half of Sahara's interrupt handler called.");
#endif

	interrupt_count++;
	reset_flag = sah_Handle_Interrupt(sah_HW_Read_Status());

	/* Schedule the Bottom Half of the Interrupt. */
	tasklet_schedule(&BH_task);

	/* To get rid of the unused parameter warnings. */
	irq = 0;
	dev_id = NULL;
	return IRQ_RETVAL(1);
}
开发者ID:AvalueAES,项目名称:rev-sa01,代码行数:31,代码来源:sah_interrupt_handler.c


注:本文中的IRQ_RETVAL函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。