• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/drivers/isdn/hysdn/

Lines Matching refs:card

37 	hysdn_card *card = dev_id;	/* parameter from irq */
42 if (!card)
44 if (!card->irq_enabled)
47 spin_lock_irqsave(&card->hysdn_lock, flags); /* no further irqs allowed */
49 if (!(bytein(card->iobase + PCI9050_INTR_REG) & PCI9050_INTR_REG_STAT1)) {
50 spin_unlock_irqrestore(&card->hysdn_lock, flags); /* restore old state */
54 dpr = card->dpram;
60 if (!card->hw_lock)
61 schedule_work(&card->irq_queue);
62 spin_unlock_irqrestore(&card->hysdn_lock, flags);
69 /* only one handling data transfer from or to the card after booting. The task */
75 hysdn_card * card = container_of(ugli_api, hysdn_card, irq_queue);
80 if (card->state != CARD_STATE_RUN)
83 dpr = card->dpram; /* point to DPRAM */
85 spin_lock_irqsave(&card->hysdn_lock, flags);
86 if (card->hw_lock) {
87 spin_unlock_irqrestore(&card->hysdn_lock, flags); /* hardware currently unavailable */
90 card->hw_lock = 1; /* we now lock the hardware */
99 if (hysdn_sched_tx(card, dpr->ToHyBuf, &dpr->ToHySize, &dpr->ToHyChannel,
108 if (hysdn_sched_rx(card, dpr->ToPcBuf, dpr->ToPcSize, dpr->ToPcChannel)) {
118 card->hw_lock = 0; /* free hardware again */
121 spin_unlock_irqrestore(&card->hysdn_lock, flags);
126 /* stop the card (hardware reset) and disable interrupts */
129 ergo_stopcard(hysdn_card * card)
134 hysdn_net_release(card); /* first release the net device if existing */
136 hycapi_capi_stop(card);
138 spin_lock_irqsave(&card->hysdn_lock, flags);
139 val = bytein(card->iobase + PCI9050_INTR_REG); /* get actual value */
141 byteout(card->iobase + PCI9050_INTR_REG, val);
142 card->irq_enabled = 0;
143 byteout(card->iobase + PCI9050_USER_IO, PCI9050_E1_RESET); /* reset E1 processor */
144 card->state = CARD_STATE_UNUSED;
145 card->err_log_state = ERRLOG_STATE_OFF; /* currently no log active */
147 spin_unlock_irqrestore(&card->hysdn_lock, flags);
154 ergo_set_errlog_state(hysdn_card * card, int on)
158 if (card->state != CARD_STATE_RUN) {
159 card->err_log_state = ERRLOG_STATE_OFF; /* must be off */
162 spin_lock_irqsave(&card->hysdn_lock, flags);
164 if (((card->err_log_state == ERRLOG_STATE_OFF) && !on) ||
165 ((card->err_log_state == ERRLOG_STATE_ON) && on)) {
166 spin_unlock_irqrestore(&card->hysdn_lock, flags);
170 card->err_log_state = ERRLOG_STATE_START; /* request start */
172 card->err_log_state = ERRLOG_STATE_STOP; /* request stop */
174 spin_unlock_irqrestore(&card->hysdn_lock, flags);
175 schedule_work(&card->irq_queue);
184 ergo_testram(hysdn_card * card)
186 tErgDpram *dpr = card->dpram;
210 /* PCI-write-buffers flushed and the card is taken out of reset. */
215 ergo_writebootimg(struct HYSDN_CARD *card, unsigned char *buf,
222 if (card->debug_flags & LOG_POF_CARD)
223 hysdn_addlog(card, "ERGO: write bootldr offs=0x%lx ", offs);
225 dst = card->dpram; /* pointer to start of DPRAM */
237 memset(card->dpram, 0, ERG_DPRAM_FILL_SIZE); /* fill the DPRAM still not cleared */
238 dpram = card->dpram; /* get pointer to dpram structure */
242 byteout(card->iobase + PCI9050_USER_IO, PCI9050_E1_RUN); /* start E1 processor */
248 if (((tDpramBootSpooler *) card->dpram)->Len != DPRAM_SPOOLER_DATA_SIZE) {
249 if (card->debug_flags & LOG_POF_CARD)
250 hysdn_addlog(card, "ERGO: write bootldr no answer");
263 ergo_writebootseq(struct HYSDN_CARD *card, unsigned char *buf, int len)
265 tDpramBootSpooler *sp = (tDpramBootSpooler *) card->dpram;
273 if (card->debug_flags & LOG_POF_CARD)
274 hysdn_addlog(card, "ERGO: write boot seq len=%d ", len);
292 if (card->debug_flags & LOG_POF_CARD)
293 hysdn_addlog(card, "ERGO: write boot seq timeout");
325 ergo_waitpofready(struct HYSDN_CARD *card)
327 tErgDpram *dpr = card->dpram; /* pointer to DPRAM structure */
333 if (card->debug_flags & LOG_POF_CARD)
334 hysdn_addlog(card, "ERGO: waiting for pof ready");
350 if (EvalSysrTokData(card, dpr->ToPcBuf + RDY_MAGIC_SIZE, msg_size))
353 if (card->debug_flags & LOG_POF_RECORD)
354 hysdn_addlog(card, "ERGO: pof boot success");
355 spin_lock_irqsave(&card->hysdn_lock, flags);
357 card->state = CARD_STATE_RUN; /* now card is running */
359 byteout(card->iobase + PCI9050_INTR_REG,
360 bytein(card->iobase + PCI9050_INTR_REG) |
362 card->irq_enabled = 1; /* we are ready to receive interrupts */
368 spin_unlock_irqrestore(&card->hysdn_lock, flags);
369 if ((hynet_enable & (1 << card->myid))
370 && (i = hysdn_net_create(card)))
372 ergo_stopcard(card);
373 card->state = CARD_STATE_BOOTERR;
377 if((i = hycapi_capi_create(card))) {
387 if (card->debug_flags & LOG_POF_CARD)
388 hysdn_addlog(card, "ERGO: pof boot ready timeout");
400 ergo_releasehardware(hysdn_card * card)
402 ergo_stopcard(card); /* first stop the card if not already done */
403 free_irq(card->irq, card); /* release interrupt */
404 release_region(card->iobase + PCI9050_INTR_REG, 1); /* release all io ports */
405 release_region(card->iobase + PCI9050_USER_IO, 1);
406 iounmap(card->dpram);
407 card->dpram = NULL; /* release shared mem */
417 ergo_inithardware(hysdn_card * card)
419 if (!request_region(card->iobase + PCI9050_INTR_REG, 1, "HYSDN"))
421 if (!request_region(card->iobase + PCI9050_USER_IO, 1, "HYSDN")) {
422 release_region(card->iobase + PCI9050_INTR_REG, 1);
425 card->memend = card->membase + ERG_DPRAM_PAGE_SIZE - 1;
426 if (!(card->dpram = ioremap(card->membase, ERG_DPRAM_PAGE_SIZE))) {
427 release_region(card->iobase + PCI9050_INTR_REG, 1);
428 release_region(card->iobase + PCI9050_USER_IO, 1);
432 ergo_stopcard(card); /* disable interrupts */
433 if (request_irq(card->irq, ergo_interrupt, IRQF_SHARED, "HYSDN", card)) {
434 ergo_releasehardware(card); /* return the acquired hardware */
438 card->stopcard = ergo_stopcard;
439 card->releasehardware = ergo_releasehardware;
440 card->testram = ergo_testram;
441 card->writebootimg = ergo_writebootimg;
442 card->writebootseq = ergo_writebootseq;
443 card->waitpofready = ergo_waitpofready;
444 card->set_errlog_state = ergo_set_errlog_state;
445 INIT_WORK(&card->irq_queue, ergo_irq_bh);
446 spin_lock_init(&card->hysdn_lock);