• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ byteout函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: writereg

static inline void
writereg(unsigned int adr, u_short off, u_char data)
{
    byteout(adr + off, data);
}
开发者ID:jhbsz,项目名称:MI424WR_GEN2_Rev_E-F,代码行数:5,代码来源:gazel.c


示例2: writereg_ipac

static inline void
writereg_ipac(unsigned int adr, u_short off, u_char data)
{
    byteout(adr, off);
    byteout(adr + 4, data);
}
开发者ID:jhbsz,项目名称:MI424WR_GEN2_Rev_E-F,代码行数:6,代码来源:gazel.c


示例3: readfifo

static inline void
readfifo(unsigned int ale, unsigned int adr, u_char off, u_char *data, int size)
{
	byteout(ale, off);
	insb(adr, data, size);
}
开发者ID:0xroot,项目名称:Blackphone-BP1-Kernel,代码行数:6,代码来源:elsa.c


示例4: WriteISACfifo

static inline void
WriteISACfifo(struct IsdnCardState *cs, u_char * data, int size)
{
	byteout(cs->hw.avm.cfg_reg+ADDRREG_OFFSET,ISAC_FIFO_OFFSET);
	outsb(cs->hw.avm.cfg_reg+DATAREG_OFFSET, data, size);
}
开发者ID:StephenMacras,项目名称:dsl-n55u-bender,代码行数:6,代码来源:avm_a1p.c


示例5: setup_netjet_s

int __init
setup_netjet_s(struct IsdnCard *card)
{
	int bytecnt;
	struct IsdnCardState *cs = card->cs;
	char tmp[64];
	long flags;

#ifdef __BIG_ENDIAN
#error "not running on big endian machines now"
#endif
	strcpy(tmp, NETjet_S_revision);
	printk(KERN_INFO "HiSax: Traverse Tech. NETjet-S driver Rev. %s\n", HiSax_getrev(tmp));
	if (cs->typ != ISDN_CTYPE_NETJET_S)
		return(0);
	test_and_clear_bit(FLG_LOCK_ATOMIC, &cs->HW_Flags);

#if CONFIG_PCI

	for ( ;; )
	{
		if (!pci_present()) {
			printk(KERN_ERR "Netjet: no PCI bus present\n");
			return(0);
		}
		if ((dev_netjet = pci_find_device(PCI_VENDOR_ID_TIGERJET,
			PCI_DEVICE_ID_TIGERJET_300,  dev_netjet))) {
			if (pci_enable_device(dev_netjet))
				return(0);
			pci_set_master(dev_netjet);
			cs->irq = dev_netjet->irq;
			if (!cs->irq) {
				printk(KERN_WARNING "NETjet-S: No IRQ for PCI card found\n");
				return(0);
			}
			cs->hw.njet.base = pci_resource_start(dev_netjet, 0);
			if (!cs->hw.njet.base) {
				printk(KERN_WARNING "NETjet-S: No IO-Adr for PCI card found\n");
				return(0);
			}
			/* 2001/10/04 Christoph Ersfeld, Formula-n Europe AG www.formula-n.com */
			if ((dev_netjet->subsystem_vendor == 0x55) &&
				(dev_netjet->subsystem_device == 0x02)) {
				printk(KERN_WARNING "Netjet: You tried to load this driver with an incompatible TigerJet-card\n");
				printk(KERN_WARNING "Use type=41 for Formula-n enter:now ISDN PCI and compatible\n");
				return(0);
			}
			/* end new code */
		} else {
			printk(KERN_WARNING "NETjet-S: No PCI card found\n");
			return(0);
		}

		cs->hw.njet.auxa = cs->hw.njet.base + NETJET_AUXDATA;
		cs->hw.njet.isac = cs->hw.njet.base | NETJET_ISAC_OFF;

		save_flags(flags);
		sti();

		cs->hw.njet.ctrl_reg = 0xff;  /* Reset On */
		byteout(cs->hw.njet.base + NETJET_CTRL, cs->hw.njet.ctrl_reg);

		set_current_state(TASK_UNINTERRUPTIBLE);
		schedule_timeout((10*HZ)/1000);	/* Timeout 10ms */

		cs->hw.njet.ctrl_reg = 0x00;  /* Reset Off and status read clear */
		byteout(cs->hw.njet.base + NETJET_CTRL, cs->hw.njet.ctrl_reg);

		set_current_state(TASK_UNINTERRUPTIBLE);
		schedule_timeout((10*HZ)/1000);	/* Timeout 10ms */

		restore_flags(flags);

		cs->hw.njet.auxd = 0xC0;
		cs->hw.njet.dmactrl = 0;

		byteout(cs->hw.njet.base + NETJET_AUXCTRL, ~NETJET_ISACIRQ);
		byteout(cs->hw.njet.base + NETJET_IRQMASK1, NETJET_ISACIRQ);
		byteout(cs->hw.njet.auxa, cs->hw.njet.auxd);

		switch ( ( ( NETjet_ReadIC( cs, ISAC_RBCH ) >> 5 ) & 3 ) )
		{
			case 0 :
				break;

			case 3 :
				printk( KERN_WARNING "NETjet-S: NETspider-U PCI card found\n" );
				continue;

			default :
				printk( KERN_WARNING "NETjet-S: No PCI card found\n" );
				return 0;
                }
                break;
	}
#else

	printk(KERN_WARNING "NETjet-S: NO_PCI_BIOS\n");
	printk(KERN_WARNING "NETjet-S: unable to config NETJET-S PCI\n");
	return (0);
//.........这里部分代码省略.........
开发者ID:ProjectZeroSlackr,项目名称:linux-2.4.32-ipod,代码行数:101,代码来源:nj_s.c


示例6: Sedl_card_msg

static int
Sedl_card_msg(struct IsdnCardState *cs, int mt, void *arg)
{
	u_long flags;

	switch (mt) {
		case CARD_RESET:
			spin_lock_irqsave(&cs->lock, flags);
			reset_sedlbauer(cs);
			spin_unlock_irqrestore(&cs->lock, flags);
			return(0);
		case CARD_RELEASE:
			if (cs->hw.sedl.chip == SEDL_CHIP_ISAC_ISAR) {
				spin_lock_irqsave(&cs->lock, flags);
				writereg(cs->hw.sedl.adr, cs->hw.sedl.hscx,
					ISAR_IRQBIT, 0);
				writereg(cs->hw.sedl.adr, cs->hw.sedl.isac,
					ISAC_MASK, 0xFF);
				reset_sedlbauer(cs);
				writereg(cs->hw.sedl.adr, cs->hw.sedl.hscx,
					ISAR_IRQBIT, 0);
				writereg(cs->hw.sedl.adr, cs->hw.sedl.isac,
					ISAC_MASK, 0xFF);
				spin_unlock_irqrestore(&cs->lock, flags);
			}
			release_io_sedlbauer(cs);
			return(0);
		case CARD_INIT:
			spin_lock_irqsave(&cs->lock, flags);
			reset_sedlbauer(cs);
			if (cs->hw.sedl.chip == SEDL_CHIP_ISAC_ISAR) {
				clear_pending_isac_ints(cs);
				writereg(cs->hw.sedl.adr, cs->hw.sedl.hscx,
					ISAR_IRQBIT, 0);
				initisac(cs);
				initisar(cs);
				/* Reenable all IRQ */
				cs->writeisac(cs, ISAC_MASK, 0);
				/* RESET Receiver and Transmitter */
				cs->writeisac(cs, ISAC_CMDR, 0x41);
			} else {
				inithscxisac(cs, 3);
			}
			spin_unlock_irqrestore(&cs->lock, flags);
			return(0);
		case CARD_TEST:
			return(0);
		case MDL_INFO_CONN:
			if (cs->subtyp != SEDL_SPEEDFAX_PYRAMID)
				return(0);
			spin_lock_irqsave(&cs->lock, flags);
			if ((long) arg)
				cs->hw.sedl.reset_off &= ~SEDL_ISAR_PCI_LED2;
			else
				cs->hw.sedl.reset_off &= ~SEDL_ISAR_PCI_LED1;
			byteout(cs->hw.sedl.cfg_reg +3, cs->hw.sedl.reset_off);
			spin_unlock_irqrestore(&cs->lock, flags);
			break;
		case MDL_INFO_REL:
			if (cs->subtyp != SEDL_SPEEDFAX_PYRAMID)
				return(0);
			spin_lock_irqsave(&cs->lock, flags);
			if ((long) arg)
				cs->hw.sedl.reset_off |= SEDL_ISAR_PCI_LED2;
			else
				cs->hw.sedl.reset_off |= SEDL_ISAR_PCI_LED1;
			byteout(cs->hw.sedl.cfg_reg +3, cs->hw.sedl.reset_off);
			spin_unlock_irqrestore(&cs->lock, flags);
			break;
	}
	return(0);
}
开发者ID:mahyarmd,项目名称:unifi-gpl,代码行数:72,代码来源:sedlbauer.c


示例7: reset_teles3

static int
reset_teles3(struct IsdnCardState *cs)
{
	long flags;
	u_char irqcfg;

	if (cs->typ != ISDN_CTYPE_TELESPCMCIA) {
		if ((cs->hw.teles3.cfg_reg) && (cs->typ != ISDN_CTYPE_COMPAQ_ISA)) {
			switch (cs->irq) {
				case 2:
				case 9:
					irqcfg = 0x00;
					break;
				case 3:
					irqcfg = 0x02;
					break;
				case 4:
					irqcfg = 0x04;
					break;
				case 5:
					irqcfg = 0x06;
					break;
				case 10:
					irqcfg = 0x08;
					break;
				case 11:
					irqcfg = 0x0A;
					break;
				case 12:
					irqcfg = 0x0C;
					break;
				case 15:
					irqcfg = 0x0E;
					break;
				default:
					return(1);
			}
			save_flags(flags);
			byteout(cs->hw.teles3.cfg_reg + 4, irqcfg);
			sti();
			HZDELAY(HZ / 10 + 1);
			byteout(cs->hw.teles3.cfg_reg + 4, irqcfg | 1);
			HZDELAY(HZ / 10 + 1);
			restore_flags(flags);
		} else if (cs->typ == ISDN_CTYPE_COMPAQ_ISA) {
			save_flags(flags);
			byteout(cs->hw.teles3.cfg_reg, 0xff);
			HZDELAY(2);
			byteout(cs->hw.teles3.cfg_reg, 0x00);
			HZDELAY(2);
			restore_flags(flags);
		} else {
			/* Reset off for 16.3 PnP , thanks to Georg Acher */
			save_flags(flags);
			byteout(cs->hw.teles3.isac + 0x3c, 0);
			HZDELAY(2);
			byteout(cs->hw.teles3.isac + 0x3c, 1);
			HZDELAY(2);
			restore_flags(flags);
		}
	}
	return(0);
}
开发者ID:dmgerman,项目名称:linux-pre-history,代码行数:63,代码来源:teles3.c


示例8: setup_sedlbauer_pci

static int __devinit
setup_sedlbauer_pci(struct IsdnCard *card)
{
	struct IsdnCardState *cs = card->cs;
	u16 sub_vendor_id, sub_id;

	if ((dev_sedl = hisax_find_pci_device(PCI_VENDOR_ID_TIGERJET,
			PCI_DEVICE_ID_TIGERJET_100, dev_sedl))) {
		if (pci_enable_device(dev_sedl))
			return(0);
		cs->irq = dev_sedl->irq;
		if (!cs->irq) {
			printk(KERN_WARNING "Sedlbauer: No IRQ for PCI card found\n");
			return(0);
		}
		cs->hw.sedl.cfg_reg = pci_resource_start(dev_sedl, 0);
	} else {
		printk(KERN_WARNING "Sedlbauer: No PCI card found\n");
		return(0);
	}
	cs->irq_flags |= IRQF_SHARED;
	cs->hw.sedl.bus = SEDL_BUS_PCI;
	sub_vendor_id = dev_sedl->subsystem_vendor;
	sub_id = dev_sedl->subsystem_device;
	printk(KERN_INFO "Sedlbauer: PCI subvendor:%x subid %x\n",
		sub_vendor_id, sub_id);
	printk(KERN_INFO "Sedlbauer: PCI base adr %#x\n",
		cs->hw.sedl.cfg_reg);
	if (sub_id != PCI_SUB_ID_SEDLBAUER) {
		printk(KERN_ERR "Sedlbauer: unknown sub id %#x\n", sub_id);
		return(0);
	}
	if (sub_vendor_id == PCI_SUBVENDOR_SPEEDFAX_PYRAMID) {
		cs->hw.sedl.chip = SEDL_CHIP_ISAC_ISAR;
		cs->subtyp = SEDL_SPEEDFAX_PYRAMID;
	} else if (sub_vendor_id == PCI_SUBVENDOR_SPEEDFAX_PCI) {
		cs->hw.sedl.chip = SEDL_CHIP_ISAC_ISAR;
		cs->subtyp = SEDL_SPEEDFAX_PCI;
	} else if (sub_vendor_id == PCI_SUBVENDOR_HST_SAPHIR3) {
		cs->hw.sedl.chip = SEDL_CHIP_IPAC;
		cs->subtyp = HST_SAPHIR3;
	} else if (sub_vendor_id == PCI_SUBVENDOR_SEDLBAUER_PCI) {
		cs->hw.sedl.chip = SEDL_CHIP_IPAC;
		cs->subtyp = SEDL_SPEED_PCI;
	} else {
		printk(KERN_ERR "Sedlbauer: unknown sub vendor id %#x\n",
			sub_vendor_id);
		return(0);
	}

	cs->hw.sedl.reset_on = SEDL_ISAR_PCI_ISAR_RESET_ON;
	cs->hw.sedl.reset_off = SEDL_ISAR_PCI_ISAR_RESET_OFF;
	byteout(cs->hw.sedl.cfg_reg, 0xff);
	byteout(cs->hw.sedl.cfg_reg, 0x00);
	byteout(cs->hw.sedl.cfg_reg+ 2, 0xdd);
	byteout(cs->hw.sedl.cfg_reg+ 5, 0); /* disable all IRQ */
	byteout(cs->hw.sedl.cfg_reg +3, cs->hw.sedl.reset_on);
	mdelay(2);
	byteout(cs->hw.sedl.cfg_reg +3, cs->hw.sedl.reset_off);
	mdelay(10);

	return (1);
}
开发者ID:119-org,项目名称:hi3518-osdrv,代码行数:63,代码来源:sedlbauer.c


示例9: readfifo

static inline void
readfifo(struct IsdnCardState *cs, unsigned int adr, u8 off, u8 * data, int size)
{
	byteout(cs->hw.asus.adr, off);
	insb(adr, data, size);
}
开发者ID:sarnobat,项目名称:knoppix,代码行数:6,代码来源:asuscom.c


示例10: ipac_writefifo

static inline void
ipac_writefifo(struct IsdnCardState *cs, u8 off, u8 * data, int size)
{
	byteout(cs->hw.asus.adr, off);
	outsb(cs->hw.asus.isac, data, size);
}
开发者ID:sarnobat,项目名称:knoppix,代码行数:6,代码来源:asuscom.c


示例11: setup_TeleInt

int __init
setup_TeleInt(struct IsdnCard *card)
{
	struct IsdnCardState *cs = card->cs;
	char tmp[64];

	strcpy(tmp, TeleInt_revision);
	printk(KERN_INFO "HiSax: TeleInt driver Rev. %s\n", HiSax_getrev(tmp));
	if (cs->typ != ISDN_CTYPE_TELEINT)
		return (0);

	cs->hw.hfc.addr = card->para[1] & 0x3fe;
	cs->irq = card->para[0];
	cs->hw.hfc.cirm = HFC_CIRM;
	cs->hw.hfc.isac_spcr = 0x00;
	cs->hw.hfc.cip = 0;
	cs->hw.hfc.ctmt = HFC_CTMT | HFC_CLTIMER;
	cs->bcs[0].hw.hfc.send = NULL;
	cs->bcs[1].hw.hfc.send = NULL;
	cs->hw.hfc.fifosize = 7 * 1024 + 512;
	cs->hw.hfc.timer.function = (void *) TeleInt_Timer;
	cs->hw.hfc.timer.data = (long) cs;
	init_timer(&cs->hw.hfc.timer);
	if (check_region((cs->hw.hfc.addr), 2)) {
		printk(KERN_WARNING
		       "HiSax: %s config port %x-%x already in use\n",
		       CardType[card->typ],
		       cs->hw.hfc.addr,
		       cs->hw.hfc.addr + 2);
		return (0);
	} else {
		request_region(cs->hw.hfc.addr, 2, "TeleInt isdn");
	}
	/* HW IO = IO */
	byteout(cs->hw.hfc.addr, cs->hw.hfc.addr & 0xff);
	byteout(cs->hw.hfc.addr | 1, ((cs->hw.hfc.addr & 0x300) >> 8) | 0x54);
	switch (cs->irq) {
		case 3:
			cs->hw.hfc.cirm |= HFC_INTA;
			break;
		case 4:
			cs->hw.hfc.cirm |= HFC_INTB;
			break;
		case 5:
			cs->hw.hfc.cirm |= HFC_INTC;
			break;
		case 7:
			cs->hw.hfc.cirm |= HFC_INTD;
			break;
		case 10:
			cs->hw.hfc.cirm |= HFC_INTE;
			break;
		case 11:
			cs->hw.hfc.cirm |= HFC_INTF;
			break;
		default:
			printk(KERN_WARNING "TeleInt: wrong IRQ\n");
			release_io_TeleInt(cs);
			return (0);
	}
	byteout(cs->hw.hfc.addr | 1, cs->hw.hfc.cirm);
	byteout(cs->hw.hfc.addr | 1, cs->hw.hfc.ctmt);

	printk(KERN_INFO
	       "TeleInt: defined at 0x%x IRQ %d\n",
	       cs->hw.hfc.addr,
	       cs->irq);

	reset_TeleInt(cs);
	cs->readisac = &ReadISAC;
	cs->writeisac = &WriteISAC;
	cs->readisacfifo = &ReadISACfifo;
	cs->writeisacfifo = &WriteISACfifo;
	cs->BC_Read_Reg = &ReadHFC;
	cs->BC_Write_Reg = &WriteHFC;
	cs->cardmsg = &TeleInt_card_msg;
	cs->irq_func = &TeleInt_interrupt;
	ISACVersion(cs, "TeleInt:");
	return (1);
}
开发者ID:froggatt,项目名称:edimax-br-6528n,代码行数:80,代码来源:teleint.c


示例12: read_fifo_ipac

static inline void
read_fifo_ipac(unsigned int adr, u_short off, u_char * data, int size)
{
    byteout(adr, off);
    insb(adr + 4, data, size);
}
开发者ID:jhbsz,项目名称:MI424WR_GEN2_Rev_E-F,代码行数:6,代码来源:gazel.c


示例13: write_fifo_ipac

static void
write_fifo_ipac(unsigned int adr, u_short off, u_char * data, int size)
{
    byteout(adr, off);
    outsb(adr + 4, data, size);
}
开发者ID:jhbsz,项目名称:MI424WR_GEN2_Rev_E-F,代码行数:6,代码来源:gazel.c


示例14: writeitac

static inline void
writeitac(struct IsdnCardState *cs, u_char off, u_char data)
{
	byteout(cs->hw.elsa.ale, off);
	byteout(cs->hw.elsa.itac, data);
}
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:6,代码来源:elsa.c


示例15: elsa_interrupt

static irqreturn_t
elsa_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
	struct IsdnCardState *cs = dev_id;
	u_long flags;
	u_char val;
	int icnt=5;

	if ((cs->typ == ISDN_CTYPE_ELSA_PCMCIA) && (*cs->busy_flag == 1)) {
	/* The card tends to generate interrupts while being removed
	   causing us to just crash the kernel. bad. */
		printk(KERN_WARNING "Elsa: card not available!\n");
		return IRQ_NONE;
	}
	spin_lock_irqsave(&cs->lock, flags);
#if ARCOFI_USE
	if (cs->hw.elsa.MFlag) {
		val = serial_inp(cs, UART_IIR);
		if (!(val & UART_IIR_NO_INT)) {
			debugl1(cs,"IIR %02x", val);
			rs_interrupt_elsa(intno, cs);
		}
	}
#endif
	val = readreg(cs->hw.elsa.ale, cs->hw.elsa.hscx, HSCX_ISTA + 0x40);
      Start_HSCX:
	if (val) {
		hscx_int_main(cs, val);
	}
	val = readreg(cs->hw.elsa.ale, cs->hw.elsa.isac, ISAC_ISTA);
      Start_ISAC:
	if (val) {
		isac_interrupt(cs, val);
	}
	val = readreg(cs->hw.elsa.ale, cs->hw.elsa.hscx, HSCX_ISTA + 0x40);
	if (val && icnt) {
		if (cs->debug & L1_DEB_HSCX)
			debugl1(cs, "HSCX IntStat after IntRoutine");
		icnt--;
		goto Start_HSCX;
	}
	val = readreg(cs->hw.elsa.ale, cs->hw.elsa.isac, ISAC_ISTA);
	if (val && icnt) {
		if (cs->debug & L1_DEB_ISAC)
			debugl1(cs, "ISAC IntStat after IntRoutine");
		icnt--;
		goto Start_ISAC;
	}
	if (!icnt)
		printk(KERN_WARNING"ELSA IRQ LOOP\n");
	writereg(cs->hw.elsa.ale, cs->hw.elsa.hscx, HSCX_MASK, 0xFF);
	writereg(cs->hw.elsa.ale, cs->hw.elsa.hscx, HSCX_MASK + 0x40, 0xFF);
	writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, ISAC_MASK, 0xFF);
	if (cs->hw.elsa.status & ELSA_TIMER_AKTIV) {
		if (!TimerRun(cs)) {
			/* Timer Restart */
			byteout(cs->hw.elsa.timer, 0);
			cs->hw.elsa.counter++;
		}
	}
#if ARCOFI_USE
	if (cs->hw.elsa.MFlag) {
		val = serial_inp(cs, UART_MCR);
		val ^= 0x8;
		serial_outp(cs, UART_MCR, val);
		val = serial_inp(cs, UART_MCR);
		val ^= 0x8;
		serial_outp(cs, UART_MCR, val);
	}
#endif
	if (cs->hw.elsa.trig)
		byteout(cs->hw.elsa.trig, 0x00);
	writereg(cs->hw.elsa.ale, cs->hw.elsa.hscx, HSCX_MASK, 0x0);
	writereg(cs->hw.elsa.ale, cs->hw.elsa.hscx, HSCX_MASK + 0x40, 0x0);
	writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, ISAC_MASK, 0x0);
	spin_unlock_irqrestore(&cs->lock, flags);
	return IRQ_HANDLED;
}
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:78,代码来源:elsa.c


示例16: setup_avm_a1

int __devinit
setup_avm_a1(struct IsdnCard *card)
{
    u_char val;
    struct IsdnCardState *cs = card->cs;
    char tmp[64];

    strcpy(tmp, avm_revision);
    printk(KERN_INFO "HiSax: AVM driver Rev. %s\n", HiSax_getrev(tmp));
    if (cs->typ != ISDN_CTYPE_A1)
        return (0);

    cs->hw.avm.cfg_reg = card->para[1] + 0x1800;
    cs->hw.avm.isac = card->para[1] + 0x1400 - 0x20;
    cs->hw.avm.hscx[0] = card->para[1] + 0x400 - 0x20;
    cs->hw.avm.hscx[1] = card->para[1] + 0xc00 - 0x20;
    cs->hw.avm.isacfifo = card->para[1] + 0x1000;
    cs->hw.avm.hscxfifo[0] = card->para[1];
    cs->hw.avm.hscxfifo[1] = card->para[1] + 0x800;
    cs->irq = card->para[0];
    if (!request_region(cs->hw.avm.cfg_reg, 8, "avm cfg")) {
        printk(KERN_WARNING
               "HiSax: AVM A1 config port %x-%x already in use\n",
               cs->hw.avm.cfg_reg,
               cs->hw.avm.cfg_reg + 8);
        return (0);
    }
    if (!request_region(cs->hw.avm.isac + 32, 32, "HiSax isac")) {
        printk(KERN_WARNING
               "HiSax: AVM A1 isac ports %x-%x already in use\n",
               cs->hw.avm.isac + 32,
               cs->hw.avm.isac + 64);
        release_ioregs(cs, 0);
        return (0);
    }
    if (!request_region(cs->hw.avm.isacfifo, 1, "HiSax isac fifo")) {
        printk(KERN_WARNING
               "HiSax: AVM A1 isac fifo port %x already in use\n",
               cs->hw.avm.isacfifo);
        release_ioregs(cs, 1);
        return (0);
    }
    if (!request_region(cs->hw.avm.hscx[0] + 32, 32, "HiSax hscx A")) {
        printk(KERN_WARNING
               "HiSax: AVM A1 hscx A ports %x-%x already in use\n",
               cs->hw.avm.hscx[0] + 32,
               cs->hw.avm.hscx[0] + 64);
        release_ioregs(cs, 3);
        return (0);
    }
    if (!request_region(cs->hw.avm.hscxfifo[0], 1, "HiSax hscx A fifo")) {
        printk(KERN_WARNING
               "HiSax: AVM A1 hscx A fifo port %x already in use\n",
               cs->hw.avm.hscxfifo[0]);
        release_ioregs(cs, 7);
        return (0);
    }
    if (!request_region(cs->hw.avm.hscx[1] + 32, 32, "HiSax hscx B")) {
        printk(KERN_WARNING
               "HiSax: AVM A1 hscx B ports %x-%x already in use\n",
               cs->hw.avm.hscx[1] + 32,
               cs->hw.avm.hscx[1] + 64);
        release_ioregs(cs, 0xf);
        return (0);
    }
    if (!request_region(cs->hw.avm.hscxfifo[1], 1, "HiSax hscx B fifo")) {
        printk(KERN_WARNING
               "HiSax: AVM A1 hscx B fifo port %x already in use\n",
               cs->hw.avm.hscxfifo[1]);
        release_ioregs(cs, 0x1f);
        return (0);
    }
    byteout(cs->hw.avm.cfg_reg, 0x0);
    HZDELAY(HZ / 5 + 1);
    byteout(cs->hw.avm.cfg_reg, 0x1);
    HZDELAY(HZ / 5 + 1);
    byteout(cs->hw.avm.cfg_reg, 0x0);
    HZDELAY(HZ / 5 + 1);
    val = cs->irq;
    if (val == 9)
        val = 2;
    byteout(cs->hw.avm.cfg_reg + 1, val);
    HZDELAY(HZ / 5 + 1);
    byteout(cs->hw.avm.cfg_reg, 0x0);
    HZDELAY(HZ / 5 + 1);

    val = bytein(cs->hw.avm.cfg_reg);
    printk(KERN_INFO "AVM A1: Byte at %x is %x\n",
           cs->hw.avm.cfg_reg, val);
    val = bytein(cs->hw.avm.cfg_reg + 3);
    printk(KERN_INFO "AVM A1: Byte at %x is %x\n",
           cs->hw.avm.cfg_reg + 3, val);
    val = bytein(cs->hw.avm.cfg_reg + 2);
    printk(KERN_INFO "AVM A1: Byte at %x is %x\n",
           cs->hw.avm.cfg_reg + 2, val);
    val = bytein(cs->hw.avm.cfg_reg);
    printk(KERN_INFO "AVM A1: Byte at %x is %x\n",
           cs->hw.avm.cfg_reg, val);

    printk(KERN_INFO "HiSax: AVM A1 config irq:%d cfg:0x%X\n",
//.........这里部分代码省略.........
开发者ID:daodaoliang,项目名称:miwifi,代码行数:101,代码来源:avm_a1.c


示例17: Elsa_card_msg

static int
Elsa_card_msg(struct IsdnCardState *cs, int mt, void *arg)
{
	int ret = 0;
	u_long flags;

	switch (mt) {
		case CARD_RESET:
			spin_lock_irqsave(&cs->lock, flags);
			reset_elsa(cs);
			spin_unlock_irqrestore(&cs->lock, flags);
			return(0);
		case CARD_RELEASE:
			release_io_elsa(cs);
			return(0);
		case CARD_INIT:
			spin_lock_irqsave(&cs->lock, flags);
			cs->debug |= L1_DEB_IPAC;
			reset_elsa(cs);
			inithscxisac(cs, 1);
			if ((cs->subtyp == ELSA_QS1000) ||
			    (cs->subtyp == ELSA_QS3000))
			{
				byteout(cs->hw.elsa.timer, 0);
			}
			if (cs->hw.elsa.trig)
				byteout(cs->hw.elsa.trig, 0xff);
			inithscxisac(cs, 2);
			spin_unlock_irqrestore(&cs->lock, flags);
			return(0);
		case CARD_TEST:
			if ((cs->subtyp == ELSA_PCMCIA) ||
				(cs->subtyp == ELSA_PCMCIA_IPAC) ||
				(cs->subtyp == ELSA_QS1000PCI)) {
				return(0);
			} else if (cs->subtyp == ELSA_QS3000PCI) {
				ret = 0;
			} else {
				spin_lock_irqsave(&cs->lock, flags);
				cs->hw.elsa.counter = 0;
				cs->hw.elsa.ctrl_reg |= ELSA_ENA_TIMER_INT;
				cs->hw.elsa.status |= ELSA_TIMER_AKTIV;
				byteout(cs->hw.elsa.ctrl, cs->hw.elsa.ctrl_reg);
				byteout(cs->hw.elsa.timer, 0);
				spin_unlock_irqrestore(&cs->lock, flags);
				msleep(110);
				spin_lock_irqsave(&cs->lock, flags);
				cs->hw.elsa.ctrl_reg &= ~ELSA_ENA_TIMER_INT;
				byteout(cs->hw.elsa.ctrl, cs->hw.elsa.ctrl_reg);
				cs->hw.elsa.status &= ~ELSA_TIMER_AKTIV;
				spin_unlock_irqrestore(&cs->lock, flags);
				printk(KERN_INFO "Elsa: %d timer tics in 110 msek\n",
				       cs->hw.elsa.counter);
				if ((cs->hw.elsa.counter > 10) &&
					(cs->hw.elsa.counter < 16)) {
					printk(KERN_INFO "Elsa: timer and irq OK\n");
					ret = 0;
				} else {
					printk(KERN_WARNING
					       "Elsa: timer tic problem (%d/12) maybe an IRQ(%d) conflict\n",
					       cs->hw.elsa.counter, cs->irq);
					ret = 1;
				}
			}
#if ARCOFI_USE
			if (check_arcofi(cs)) {
				init_modem(cs);
			}
#endif
			elsa_led_handler(cs);
			return(ret);
		case (MDL_REMOVE | REQUEST):
			cs->hw.elsa.status &= 0;
			break;
		case (MDL_ASSIGN | REQUEST):
			cs->hw.elsa.status |= ELSA_ASSIGN;
			break;
		case MDL_INFO_SETUP:
			if ((long) arg)
				cs->hw.elsa.status |= 0x0200;
			else
				cs->hw.elsa.status |= 0x0100;
			break;
		case MDL_INFO_CONN:
			if ((long) arg)
				cs->hw.elsa.status |= 0x2000;
			else
				cs->hw.elsa.status |= 0x1000;
			break;
		case MDL_INFO_REL:
			if ((long) arg) {
				cs->hw.elsa.status &= ~0x2000;
				cs->hw.elsa.status &= ~0x0200;
			} else {
				cs->hw.elsa.status &= ~0x1000;
				cs->hw.elsa.status &= ~0x0100;
			}
			break;
#if ARCOFI_USE
		case CARD_AUX_IND:
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:101,代码来源:elsa.c


示例18: writefifo

static inline void
writefifo(struct IsdnCardState *cs, unsigned int adr, u8 off, u8 *data, int size)
{
	byteout(cs->hw.saphir.ale, off);
	outsb(adr, data, size);
}
开发者ID:xricson,项目名称:knoppix,代码行数:6,代码来源:saphir.c


示例19: netjet_s_interrupt

static irqreturn_t
netjet_s_interrupt(int intno, void *dev_id)
{
	struct IsdnCardState *cs = dev_id;
	u_char val, s1val, s0val;
	u_long flags;

	spin_lock_irqsave(&cs->lock, flags);
	s1val = bytein(cs->hw.njet.base + NETJET_IRQSTAT1);
	if (!(s1val & NETJET_ISACIRQ)) {
		val = NETjet_ReadIC(cs, ISAC_ISTA);
		if (cs->debug & L1_DEB_ISAC)
			debugl1(cs, "tiger: i1 %x %x", s1val, val);
		if (val) {
			isac_interrupt(cs, val);
			NETjet_WriteIC(cs, ISAC_MASK, 0xFF);
			NETjet_WriteIC(cs, ISAC_MASK, 0x0);
		}
		s1val = 1;
	} else
		s1val = 0;
	/* 
	 * read/write stat0 is better, because lower IRQ rate
	 * Note the IRQ is on for 125 us if a condition match
	 * thats long on modern CPU and so the IRQ is reentered
	 * all the time.
	 */
	s0val = bytein(cs->hw.njet.base + NETJET_IRQSTAT0);
	if ((s0val | s1val)==0) { // shared IRQ
		spin_unlock_irqrestore(&cs->lock, flags);
		return IRQ_NONE;
	} 
	if (s0val)
		byteout(cs->hw.njet.base + NETJET_IRQSTAT0, s0val);
	/* start new code 13/07/00 GE */
	/* set bits in sval to indicate which page is free */
	if (inl(cs->hw.njet.base + NETJET_DMA_WRITE_ADR) <
		inl(cs->hw.njet.base + NETJET_DMA_WRITE_IRQ))
		/* the 2nd write page is free */
		s0val = 0x08;
	else	/* the 1st write page is free */
		s0val = 0x04;	
	if (inl(cs->hw.njet.base + NETJET_DMA_READ_ADR) <
		inl(cs->hw.njet.base + NETJET_DMA_READ_IRQ))
		/* the 2nd read page is free */
		s0val |= 0x02;
	else	/* the 1st read page is free */
		s0val |= 0x01;	
	if (s0val != cs->hw.njet.last_is0) /* we have a DMA interrupt */
	{
		if (test_and_set_bit(FLG_LOCK_ATOMIC, &cs->HW_Flags)) {
			printk(KERN_WARNING "nj LOCK_ATOMIC s0val %x->%x\n",
				cs->hw.njet.last_is0, s0val);
			spin_unlock_irqrestore(&cs->lock, flags);
			return IRQ_HANDLED;
		}
		cs->hw.njet.irqstat0 = s0val;
		if ((cs->hw.njet.irqstat0 & NETJET_IRQM0_READ) != 
			(cs->hw.njet.last_is0 & NETJET_IRQM0_READ))
			/* we have a read dma int */
			read_tiger(cs);
		if ((cs->hw.njet.irqstat0 & NETJET_IRQM0_WRITE) !=
			(cs->hw.njet.last_is0 & NETJET_IRQM0_WRITE))
			/* we have a write dma int */
			write_tiger(cs);
		/* end new code 13/07/00 GE */
		test_and_clear_bit(FLG_LOCK_ATOMIC, &cs->HW_Flags);
	}
	spin_unlock_irqrestore(&cs->lock, flags);
	return IRQ_HANDLED;
}
开发者ID:patrick-ken,项目名称:kernel_808l,代码行数:71,代码来源:nj_s.c


示例20: writereg

static inline void
writereg(unsigned int ale, unsigned int adr, u_char off, u_char data)
{
	byteout(ale, off);
	byteout(adr, data);
}
开发者ID:0xroot,项目名称:Blackphone-BP1-Kernel,代码行数:6,代码来源:elsa.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ bytesAvailable函数代码示例发布时间:2022-05-30
下一篇:
C++ byteorder_htons函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap