Lines Matching refs:sf
126 struct sfax_hw *sf = dev_id;
130 spin_lock(&sf->lock);
131 val = inb(sf->cfg + TIGER_AUX_STATUS);
133 spin_unlock(&sf->lock);
136 sf->irqcnt++;
137 val = ReadISAR_IND(sf, ISAR_IRQBIT);
140 mISDNisar_irq(&sf->isar);
141 val = ReadISAC_IND(sf, ISAC_ISTA);
143 mISDNisac_irq(&sf->isac, val);
144 val = ReadISAR_IND(sf, ISAR_IRQBIT);
148 pr_debug("%s: %d irqloops cpu%d\n", sf->name,
151 pr_notice("%s: %d IRQ LOOP cpu%d\n", sf->name,
153 spin_unlock(&sf->lock);
158 enable_hwirq(struct sfax_hw *sf)
160 WriteISAC_IND(sf, ISAC_MASK, 0);
161 WriteISAR_IND(sf, ISAR_IRQBIT, ISAR_IRQMSK);
162 outb(SFAX_TIGER_IRQ_BIT, sf->cfg + TIGER_AUX_IRQMASK);
166 disable_hwirq(struct sfax_hw *sf)
168 WriteISAC_IND(sf, ISAC_MASK, 0xFF);
169 WriteISAR_IND(sf, ISAR_IRQBIT, 0);
170 outb(0, sf->cfg + TIGER_AUX_IRQMASK);
174 reset_speedfax(struct sfax_hw *sf)
177 pr_debug("%s: resetting card\n", sf->name);
178 outb(TIGER_EXTERN_RESET_ON, sf->cfg + TIGER_RESET_ADDR);
179 outb(SFAX_PCI_RESET_ON, sf->cfg + TIGER_AUX_DATA);
181 outb(TIGER_EXTERN_RESET_OFF, sf->cfg + TIGER_RESET_ADDR);
182 sf->aux_data = SFAX_PCI_RESET_OFF;
183 outb(sf->aux_data, sf->cfg + TIGER_AUX_DATA);
188 sfax_ctrl(struct sfax_hw *sf, u32 cmd, u_long arg)
194 reset_speedfax(sf);
198 sf->aux_data &= ~SFAX_LED1_BIT;
200 sf->aux_data &= ~SFAX_LED2_BIT;
201 outb(sf->aux_data, sf->cfg + TIGER_AUX_DATA);
205 sf->aux_data |= SFAX_LED1_BIT;
207 sf->aux_data |= SFAX_LED2_BIT;
208 outb(sf->aux_data, sf->cfg + TIGER_AUX_DATA);
212 sf->name, __func__, cmd, arg);
220 channel_ctrl(struct sfax_hw *sf, struct mISDN_ctrl_req *cq)
234 ret = sf->isac.ctrl(&sf->isac, HW_TESTLOOP, cq->channel);
237 pr_info("%s: unknown Op %x\n", sf->name, cq->op);
249 struct sfax_hw *sf = dch->hw;
253 pr_debug("%s: cmd:%x %p\n", sf->name, cmd, arg);
258 err = sf->isac.open(&sf->isac, rq);
260 err = sf->isar.open(&sf->isar, rq);
264 pr_info("%s: cannot get module\n", sf->name);
267 pr_debug("%s: dev(%d) close from %p\n", sf->name,
272 err = channel_ctrl(sf, arg);
275 pr_debug("%s: unknown command %x\n", sf->name, cmd);
282 init_card(struct sfax_hw *sf)
287 ret = request_irq(sf->irq, speedfax_irq, IRQF_SHARED, sf->name, sf);
289 pr_info("%s: couldn't get interrupt %d\n", sf->name, sf->irq);
293 spin_lock_irqsave(&sf->lock, flags);
294 ret = sf->isac.init(&sf->isac);
296 spin_unlock_irqrestore(&sf->lock, flags);
298 sf->name, ret);
301 enable_hwirq(sf);
303 WriteISAC_IND(sf, ISAC_CMDR, 0x41);
304 spin_unlock_irqrestore(&sf->lock, flags);
307 pr_notice("%s: IRQ %d count %d\n", sf->name,
308 sf->irq, sf->irqcnt);
309 if (!sf->irqcnt) {
311 sf->name, sf->irq, 3 - cnt);
315 free_irq(sf->irq, sf);
321 setup_speedfax(struct sfax_hw *sf)
325 if (!request_region(sf->cfg, 256, sf->name)) {
327 sf->name, sf->cfg, sf->cfg + 255);
330 outb(0xff, sf->cfg);
331 outb(0, sf->cfg);
332 outb(0xdd, sf->cfg + TIGER_AUX_CTRL);
333 outb(0, sf->cfg + TIGER_AUX_IRQMASK);
335 sf->isac.type = IPAC_TYPE_ISAC;
336 sf->p_isac.ale = sf->cfg + SFAX_PCI_ADDR;
337 sf->p_isac.port = sf->cfg + SFAX_PCI_ISAC;
338 sf->p_isar.ale = sf->cfg + SFAX_PCI_ADDR;
339 sf->p_isar.port = sf->cfg + SFAX_PCI_ISAR;
340 ASSIGN_FUNC(IND, ISAC, sf->isac);
341 ASSIGN_FUNC(IND, ISAR, sf->isar);
342 spin_lock_irqsave(&sf->lock, flags);
343 reset_speedfax(sf);
344 disable_hwirq(sf);
345 spin_unlock_irqrestore(&sf->lock, flags);