Lines Matching refs:sf
115 struct sfax_hw *sf = dev_id; in IOFUNC_IND() local
119 spin_lock(&sf->lock); in IOFUNC_IND()
120 val = inb(sf->cfg + TIGER_AUX_STATUS); in IOFUNC_IND()
122 spin_unlock(&sf->lock); in IOFUNC_IND()
125 sf->irqcnt++; in IOFUNC_IND()
126 val = ReadISAR_IND(sf, ISAR_IRQBIT); in IOFUNC_IND()
129 mISDNisar_irq(&sf->isar); in IOFUNC_IND()
130 val = ReadISAC_IND(sf, ISAC_ISTA); in IOFUNC_IND()
132 mISDNisac_irq(&sf->isac, val); in IOFUNC_IND()
133 val = ReadISAR_IND(sf, ISAR_IRQBIT); in IOFUNC_IND()
137 pr_debug("%s: %d irqloops cpu%d\n", sf->name, in IOFUNC_IND()
140 pr_notice("%s: %d IRQ LOOP cpu%d\n", sf->name, in IOFUNC_IND()
142 spin_unlock(&sf->lock); in IOFUNC_IND()
147 enable_hwirq(struct sfax_hw *sf) in enable_hwirq() argument
149 WriteISAC_IND(sf, ISAC_MASK, 0); in enable_hwirq()
150 WriteISAR_IND(sf, ISAR_IRQBIT, ISAR_IRQMSK); in enable_hwirq()
151 outb(SFAX_TIGER_IRQ_BIT, sf->cfg + TIGER_AUX_IRQMASK); in enable_hwirq()
155 disable_hwirq(struct sfax_hw *sf) in disable_hwirq() argument
157 WriteISAC_IND(sf, ISAC_MASK, 0xFF); in disable_hwirq()
158 WriteISAR_IND(sf, ISAR_IRQBIT, 0); in disable_hwirq()
159 outb(0, sf->cfg + TIGER_AUX_IRQMASK); in disable_hwirq()
163 reset_speedfax(struct sfax_hw *sf) in reset_speedfax() argument
166 pr_debug("%s: resetting card\n", sf->name); in reset_speedfax()
167 outb(TIGER_EXTERN_RESET_ON, sf->cfg + TIGER_RESET_ADDR); in reset_speedfax()
168 outb(SFAX_PCI_RESET_ON, sf->cfg + TIGER_AUX_DATA); in reset_speedfax()
170 outb(TIGER_EXTERN_RESET_OFF, sf->cfg + TIGER_RESET_ADDR); in reset_speedfax()
171 sf->aux_data = SFAX_PCI_RESET_OFF; in reset_speedfax()
172 outb(sf->aux_data, sf->cfg + TIGER_AUX_DATA); in reset_speedfax()
177 sfax_ctrl(struct sfax_hw *sf, u32 cmd, u_long arg) in sfax_ctrl() argument
183 reset_speedfax(sf); in sfax_ctrl()
187 sf->aux_data &= ~SFAX_LED1_BIT; in sfax_ctrl()
189 sf->aux_data &= ~SFAX_LED2_BIT; in sfax_ctrl()
190 outb(sf->aux_data, sf->cfg + TIGER_AUX_DATA); in sfax_ctrl()
194 sf->aux_data |= SFAX_LED1_BIT; in sfax_ctrl()
196 sf->aux_data |= SFAX_LED2_BIT; in sfax_ctrl()
197 outb(sf->aux_data, sf->cfg + TIGER_AUX_DATA); in sfax_ctrl()
201 sf->name, __func__, cmd, arg); in sfax_ctrl()
209 channel_ctrl(struct sfax_hw *sf, struct mISDN_ctrl_req *cq) in channel_ctrl() argument
223 ret = sf->isac.ctrl(&sf->isac, HW_TESTLOOP, cq->channel); in channel_ctrl()
226 ret = sf->isac.ctrl(&sf->isac, HW_TIMER3_VALUE, cq->p1); in channel_ctrl()
229 pr_info("%s: unknown Op %x\n", sf->name, cq->op); in channel_ctrl()
241 struct sfax_hw *sf = dch->hw; in sfax_dctrl() local
245 pr_debug("%s: cmd:%x %p\n", sf->name, cmd, arg); in sfax_dctrl()
250 err = sf->isac.open(&sf->isac, rq); in sfax_dctrl()
252 err = sf->isar.open(&sf->isar, rq); in sfax_dctrl()
256 pr_info("%s: cannot get module\n", sf->name); in sfax_dctrl()
259 pr_debug("%s: dev(%d) close from %p\n", sf->name, in sfax_dctrl()
264 err = channel_ctrl(sf, arg); in sfax_dctrl()
267 pr_debug("%s: unknown command %x\n", sf->name, cmd); in sfax_dctrl()
274 init_card(struct sfax_hw *sf) in init_card() argument
279 ret = request_irq(sf->irq, speedfax_irq, IRQF_SHARED, sf->name, sf); in init_card()
281 pr_info("%s: couldn't get interrupt %d\n", sf->name, sf->irq); in init_card()
285 spin_lock_irqsave(&sf->lock, flags); in init_card()
286 ret = sf->isac.init(&sf->isac); in init_card()
288 spin_unlock_irqrestore(&sf->lock, flags); in init_card()
290 sf->name, ret); in init_card()
293 enable_hwirq(sf); in init_card()
295 WriteISAC_IND(sf, ISAC_CMDR, 0x41); in init_card()
296 spin_unlock_irqrestore(&sf->lock, flags); in init_card()
299 pr_notice("%s: IRQ %d count %d\n", sf->name, in init_card()
300 sf->irq, sf->irqcnt); in init_card()
301 if (!sf->irqcnt) { in init_card()
303 sf->name, sf->irq, 3 - cnt); in init_card()
307 free_irq(sf->irq, sf); in init_card()
313 setup_speedfax(struct sfax_hw *sf) in setup_speedfax() argument
317 if (!request_region(sf->cfg, 256, sf->name)) { in setup_speedfax()
319 sf->name, sf->cfg, sf->cfg + 255); in setup_speedfax()
322 outb(0xff, sf->cfg); in setup_speedfax()
323 outb(0, sf->cfg); in setup_speedfax()
324 outb(0xdd, sf->cfg + TIGER_AUX_CTRL); in setup_speedfax()
325 outb(0, sf->cfg + TIGER_AUX_IRQMASK); in setup_speedfax()
327 sf->isac.type = IPAC_TYPE_ISAC; in setup_speedfax()
328 sf->p_isac.ale = sf->cfg + SFAX_PCI_ADDR; in setup_speedfax()
329 sf->p_isac.port = sf->cfg + SFAX_PCI_ISAC; in setup_speedfax()
330 sf->p_isar.ale = sf->cfg + SFAX_PCI_ADDR; in setup_speedfax()
331 sf->p_isar.port = sf->cfg + SFAX_PCI_ISAR; in setup_speedfax()
332 ASSIGN_FUNC(IND, ISAC, sf->isac); in setup_speedfax()
333 ASSIGN_FUNC(IND, ISAR, sf->isar); in setup_speedfax()
334 spin_lock_irqsave(&sf->lock, flags); in setup_speedfax()
335 reset_speedfax(sf); in setup_speedfax()
336 disable_hwirq(sf); in setup_speedfax()
337 spin_unlock_irqrestore(&sf->lock, flags); in setup_speedfax()