• Home
  • Raw
  • Download

Lines Matching refs:card

37 	hysdn_card *card = dev_id;	/* parameter from irq */  in ergo_interrupt()  local
42 if (!card) in ergo_interrupt()
44 if (!card->irq_enabled) in ergo_interrupt()
47 spin_lock_irqsave(&card->hysdn_lock, flags); /* no further irqs allowed */ in ergo_interrupt()
49 if (!(bytein(card->iobase + PCI9050_INTR_REG) & PCI9050_INTR_REG_STAT1)) { in ergo_interrupt()
50 spin_unlock_irqrestore(&card->hysdn_lock, flags); /* restore old state */ in ergo_interrupt()
54 dpr = card->dpram; in ergo_interrupt()
60 if (!card->hw_lock) in ergo_interrupt()
61 schedule_work(&card->irq_queue); in ergo_interrupt()
62 spin_unlock_irqrestore(&card->hysdn_lock, flags); in ergo_interrupt()
76 hysdn_card *card = container_of(ugli_api, hysdn_card, irq_queue); in ergo_irq_bh() local
81 if (card->state != CARD_STATE_RUN) in ergo_irq_bh()
84 dpr = card->dpram; /* point to DPRAM */ in ergo_irq_bh()
86 spin_lock_irqsave(&card->hysdn_lock, flags); in ergo_irq_bh()
87 if (card->hw_lock) { in ergo_irq_bh()
88 spin_unlock_irqrestore(&card->hysdn_lock, flags); /* hardware currently unavailable */ in ergo_irq_bh()
91 card->hw_lock = 1; /* we now lock the hardware */ in ergo_irq_bh()
99 if (hysdn_sched_tx(card, dpr->ToHyBuf, &dpr->ToHySize, &dpr->ToHyChannel, in ergo_irq_bh()
108 if (hysdn_sched_rx(card, dpr->ToPcBuf, dpr->ToPcSize, dpr->ToPcChannel)) { in ergo_irq_bh()
117 card->hw_lock = 0; /* free hardware again */ in ergo_irq_bh()
120 spin_unlock_irqrestore(&card->hysdn_lock, flags); in ergo_irq_bh()
128 ergo_stopcard(hysdn_card *card) in ergo_stopcard() argument
133 hysdn_net_release(card); /* first release the net device if existing */ in ergo_stopcard()
135 hycapi_capi_stop(card); in ergo_stopcard()
137 spin_lock_irqsave(&card->hysdn_lock, flags); in ergo_stopcard()
138 val = bytein(card->iobase + PCI9050_INTR_REG); /* get actual value */ in ergo_stopcard()
140 byteout(card->iobase + PCI9050_INTR_REG, val); in ergo_stopcard()
141 card->irq_enabled = 0; in ergo_stopcard()
142 byteout(card->iobase + PCI9050_USER_IO, PCI9050_E1_RESET); /* reset E1 processor */ in ergo_stopcard()
143 card->state = CARD_STATE_UNUSED; in ergo_stopcard()
144 card->err_log_state = ERRLOG_STATE_OFF; /* currently no log active */ in ergo_stopcard()
146 spin_unlock_irqrestore(&card->hysdn_lock, flags); in ergo_stopcard()
153 ergo_set_errlog_state(hysdn_card *card, int on) in ergo_set_errlog_state() argument
157 if (card->state != CARD_STATE_RUN) { in ergo_set_errlog_state()
158 card->err_log_state = ERRLOG_STATE_OFF; /* must be off */ in ergo_set_errlog_state()
161 spin_lock_irqsave(&card->hysdn_lock, flags); in ergo_set_errlog_state()
163 if (((card->err_log_state == ERRLOG_STATE_OFF) && !on) || in ergo_set_errlog_state()
164 ((card->err_log_state == ERRLOG_STATE_ON) && on)) { in ergo_set_errlog_state()
165 spin_unlock_irqrestore(&card->hysdn_lock, flags); in ergo_set_errlog_state()
169 card->err_log_state = ERRLOG_STATE_START; /* request start */ in ergo_set_errlog_state()
171 card->err_log_state = ERRLOG_STATE_STOP; /* request stop */ in ergo_set_errlog_state()
173 spin_unlock_irqrestore(&card->hysdn_lock, flags); in ergo_set_errlog_state()
174 schedule_work(&card->irq_queue); in ergo_set_errlog_state()
183 ergo_testram(hysdn_card *card) in ergo_testram() argument
185 tErgDpram *dpr = card->dpram; in ergo_testram()
214 ergo_writebootimg(struct HYSDN_CARD *card, unsigned char *buf, in ergo_writebootimg() argument
221 if (card->debug_flags & LOG_POF_CARD) in ergo_writebootimg()
222 hysdn_addlog(card, "ERGO: write bootldr offs=0x%lx ", offs); in ergo_writebootimg()
224 dst = card->dpram; /* pointer to start of DPRAM */ in ergo_writebootimg()
236 memset(card->dpram, 0, ERG_DPRAM_FILL_SIZE); /* fill the DPRAM still not cleared */ in ergo_writebootimg()
237 dpram = card->dpram; /* get pointer to dpram structure */ in ergo_writebootimg()
241 byteout(card->iobase + PCI9050_USER_IO, PCI9050_E1_RUN); /* start E1 processor */ in ergo_writebootimg()
246 if (((tDpramBootSpooler *) card->dpram)->Len != DPRAM_SPOOLER_DATA_SIZE) { in ergo_writebootimg()
247 if (card->debug_flags & LOG_POF_CARD) in ergo_writebootimg()
248 hysdn_addlog(card, "ERGO: write bootldr no answer"); in ergo_writebootimg()
261 ergo_writebootseq(struct HYSDN_CARD *card, unsigned char *buf, int len) in ergo_writebootseq() argument
263 tDpramBootSpooler *sp = (tDpramBootSpooler *) card->dpram; in ergo_writebootseq()
271 if (card->debug_flags & LOG_POF_CARD) in ergo_writebootseq()
272 hysdn_addlog(card, "ERGO: write boot seq len=%d ", len); in ergo_writebootseq()
289 if (card->debug_flags & LOG_POF_CARD) in ergo_writebootseq()
290 hysdn_addlog(card, "ERGO: write boot seq timeout"); in ergo_writebootseq()
322 ergo_waitpofready(struct HYSDN_CARD *card) in ergo_waitpofready() argument
324 tErgDpram *dpr = card->dpram; /* pointer to DPRAM structure */ in ergo_waitpofready()
330 if (card->debug_flags & LOG_POF_CARD) in ergo_waitpofready()
331 hysdn_addlog(card, "ERGO: waiting for pof ready"); in ergo_waitpofready()
347 if (EvalSysrTokData(card, dpr->ToPcBuf + RDY_MAGIC_SIZE, msg_size)) in ergo_waitpofready()
350 if (card->debug_flags & LOG_POF_RECORD) in ergo_waitpofready()
351 hysdn_addlog(card, "ERGO: pof boot success"); in ergo_waitpofready()
352 spin_lock_irqsave(&card->hysdn_lock, flags); in ergo_waitpofready()
354 card->state = CARD_STATE_RUN; /* now card is running */ in ergo_waitpofready()
356 byteout(card->iobase + PCI9050_INTR_REG, in ergo_waitpofready()
357 bytein(card->iobase + PCI9050_INTR_REG) | in ergo_waitpofready()
359 card->irq_enabled = 1; /* we are ready to receive interrupts */ in ergo_waitpofready()
365 spin_unlock_irqrestore(&card->hysdn_lock, flags); in ergo_waitpofready()
366 if ((hynet_enable & (1 << card->myid)) in ergo_waitpofready()
367 && (i = hysdn_net_create(card))) in ergo_waitpofready()
369 ergo_stopcard(card); in ergo_waitpofready()
370 card->state = CARD_STATE_BOOTERR; in ergo_waitpofready()
374 if ((i = hycapi_capi_create(card))) { in ergo_waitpofready()
383 if (card->debug_flags & LOG_POF_CARD) in ergo_waitpofready()
384 hysdn_addlog(card, "ERGO: pof boot ready timeout"); in ergo_waitpofready()
396 ergo_releasehardware(hysdn_card *card) in ergo_releasehardware() argument
398 ergo_stopcard(card); /* first stop the card if not already done */ in ergo_releasehardware()
399 free_irq(card->irq, card); /* release interrupt */ in ergo_releasehardware()
400 release_region(card->iobase + PCI9050_INTR_REG, 1); /* release all io ports */ in ergo_releasehardware()
401 release_region(card->iobase + PCI9050_USER_IO, 1); in ergo_releasehardware()
402 iounmap(card->dpram); in ergo_releasehardware()
403 card->dpram = NULL; /* release shared mem */ in ergo_releasehardware()
413 ergo_inithardware(hysdn_card *card) in ergo_inithardware() argument
415 if (!request_region(card->iobase + PCI9050_INTR_REG, 1, "HYSDN")) in ergo_inithardware()
417 if (!request_region(card->iobase + PCI9050_USER_IO, 1, "HYSDN")) { in ergo_inithardware()
418 release_region(card->iobase + PCI9050_INTR_REG, 1); in ergo_inithardware()
421 card->memend = card->membase + ERG_DPRAM_PAGE_SIZE - 1; in ergo_inithardware()
422 if (!(card->dpram = ioremap(card->membase, ERG_DPRAM_PAGE_SIZE))) { in ergo_inithardware()
423 release_region(card->iobase + PCI9050_INTR_REG, 1); in ergo_inithardware()
424 release_region(card->iobase + PCI9050_USER_IO, 1); in ergo_inithardware()
428 ergo_stopcard(card); /* disable interrupts */ in ergo_inithardware()
429 if (request_irq(card->irq, ergo_interrupt, IRQF_SHARED, "HYSDN", card)) { in ergo_inithardware()
430 ergo_releasehardware(card); /* return the acquired hardware */ in ergo_inithardware()
434 card->stopcard = ergo_stopcard; in ergo_inithardware()
435 card->releasehardware = ergo_releasehardware; in ergo_inithardware()
436 card->testram = ergo_testram; in ergo_inithardware()
437 card->writebootimg = ergo_writebootimg; in ergo_inithardware()
438 card->writebootseq = ergo_writebootseq; in ergo_inithardware()
439 card->waitpofready = ergo_waitpofready; in ergo_inithardware()
440 card->set_errlog_state = ergo_set_errlog_state; in ergo_inithardware()
441 INIT_WORK(&card->irq_queue, ergo_irq_bh); in ergo_inithardware()
442 spin_lock_init(&card->hysdn_lock); in ergo_inithardware()