Lines Matching refs:sf

127 	struct sfax_hw	*sf = dev_id;  in IOFUNC_IND()  local
131 spin_lock(&sf->lock); in IOFUNC_IND()
132 val = inb(sf->cfg + TIGER_AUX_STATUS); in IOFUNC_IND()
134 spin_unlock(&sf->lock); in IOFUNC_IND()
137 sf->irqcnt++; in IOFUNC_IND()
138 val = ReadISAR_IND(sf, ISAR_IRQBIT); in IOFUNC_IND()
141 mISDNisar_irq(&sf->isar); in IOFUNC_IND()
142 val = ReadISAC_IND(sf, ISAC_ISTA); in IOFUNC_IND()
144 mISDNisac_irq(&sf->isac, val); in IOFUNC_IND()
145 val = ReadISAR_IND(sf, ISAR_IRQBIT); in IOFUNC_IND()
149 pr_debug("%s: %d irqloops cpu%d\n", sf->name, in IOFUNC_IND()
152 pr_notice("%s: %d IRQ LOOP cpu%d\n", sf->name, in IOFUNC_IND()
154 spin_unlock(&sf->lock); in IOFUNC_IND()
159 enable_hwirq(struct sfax_hw *sf) in enable_hwirq() argument
161 WriteISAC_IND(sf, ISAC_MASK, 0); in enable_hwirq()
162 WriteISAR_IND(sf, ISAR_IRQBIT, ISAR_IRQMSK); in enable_hwirq()
163 outb(SFAX_TIGER_IRQ_BIT, sf->cfg + TIGER_AUX_IRQMASK); in enable_hwirq()
167 disable_hwirq(struct sfax_hw *sf) in disable_hwirq() argument
169 WriteISAC_IND(sf, ISAC_MASK, 0xFF); in disable_hwirq()
170 WriteISAR_IND(sf, ISAR_IRQBIT, 0); in disable_hwirq()
171 outb(0, sf->cfg + TIGER_AUX_IRQMASK); in disable_hwirq()
175 reset_speedfax(struct sfax_hw *sf) in reset_speedfax() argument
178 pr_debug("%s: resetting card\n", sf->name); in reset_speedfax()
179 outb(TIGER_EXTERN_RESET_ON, sf->cfg + TIGER_RESET_ADDR); in reset_speedfax()
180 outb(SFAX_PCI_RESET_ON, sf->cfg + TIGER_AUX_DATA); in reset_speedfax()
182 outb(TIGER_EXTERN_RESET_OFF, sf->cfg + TIGER_RESET_ADDR); in reset_speedfax()
183 sf->aux_data = SFAX_PCI_RESET_OFF; in reset_speedfax()
184 outb(sf->aux_data, sf->cfg + TIGER_AUX_DATA); in reset_speedfax()
189 sfax_ctrl(struct sfax_hw *sf, u32 cmd, u_long arg) in sfax_ctrl() argument
195 reset_speedfax(sf); in sfax_ctrl()
199 sf->aux_data &= ~SFAX_LED1_BIT; in sfax_ctrl()
201 sf->aux_data &= ~SFAX_LED2_BIT; in sfax_ctrl()
202 outb(sf->aux_data, sf->cfg + TIGER_AUX_DATA); in sfax_ctrl()
206 sf->aux_data |= SFAX_LED1_BIT; in sfax_ctrl()
208 sf->aux_data |= SFAX_LED2_BIT; in sfax_ctrl()
209 outb(sf->aux_data, sf->cfg + TIGER_AUX_DATA); in sfax_ctrl()
213 sf->name, __func__, cmd, arg); in sfax_ctrl()
221 channel_ctrl(struct sfax_hw *sf, struct mISDN_ctrl_req *cq) in channel_ctrl() argument
235 ret = sf->isac.ctrl(&sf->isac, HW_TESTLOOP, cq->channel); in channel_ctrl()
238 ret = sf->isac.ctrl(&sf->isac, HW_TIMER3_VALUE, cq->p1); in channel_ctrl()
241 pr_info("%s: unknown Op %x\n", sf->name, cq->op); in channel_ctrl()
253 struct sfax_hw *sf = dch->hw; in sfax_dctrl() local
257 pr_debug("%s: cmd:%x %p\n", sf->name, cmd, arg); in sfax_dctrl()
262 err = sf->isac.open(&sf->isac, rq); in sfax_dctrl()
264 err = sf->isar.open(&sf->isar, rq); in sfax_dctrl()
268 pr_info("%s: cannot get module\n", sf->name); in sfax_dctrl()
271 pr_debug("%s: dev(%d) close from %p\n", sf->name, in sfax_dctrl()
276 err = channel_ctrl(sf, arg); in sfax_dctrl()
279 pr_debug("%s: unknown command %x\n", sf->name, cmd); in sfax_dctrl()
286 init_card(struct sfax_hw *sf) in init_card() argument
291 ret = request_irq(sf->irq, speedfax_irq, IRQF_SHARED, sf->name, sf); in init_card()
293 pr_info("%s: couldn't get interrupt %d\n", sf->name, sf->irq); in init_card()
297 spin_lock_irqsave(&sf->lock, flags); in init_card()
298 ret = sf->isac.init(&sf->isac); in init_card()
300 spin_unlock_irqrestore(&sf->lock, flags); in init_card()
302 sf->name, ret); in init_card()
305 enable_hwirq(sf); in init_card()
307 WriteISAC_IND(sf, ISAC_CMDR, 0x41); in init_card()
308 spin_unlock_irqrestore(&sf->lock, flags); in init_card()
311 pr_notice("%s: IRQ %d count %d\n", sf->name, in init_card()
312 sf->irq, sf->irqcnt); in init_card()
313 if (!sf->irqcnt) { in init_card()
315 sf->name, sf->irq, 3 - cnt); in init_card()
319 free_irq(sf->irq, sf); in init_card()
325 setup_speedfax(struct sfax_hw *sf) in setup_speedfax() argument
329 if (!request_region(sf->cfg, 256, sf->name)) { in setup_speedfax()
331 sf->name, sf->cfg, sf->cfg + 255); in setup_speedfax()
334 outb(0xff, sf->cfg); in setup_speedfax()
335 outb(0, sf->cfg); in setup_speedfax()
336 outb(0xdd, sf->cfg + TIGER_AUX_CTRL); in setup_speedfax()
337 outb(0, sf->cfg + TIGER_AUX_IRQMASK); in setup_speedfax()
339 sf->isac.type = IPAC_TYPE_ISAC; in setup_speedfax()
340 sf->p_isac.ale = sf->cfg + SFAX_PCI_ADDR; in setup_speedfax()
341 sf->p_isac.port = sf->cfg + SFAX_PCI_ISAC; in setup_speedfax()
342 sf->p_isar.ale = sf->cfg + SFAX_PCI_ADDR; in setup_speedfax()
343 sf->p_isar.port = sf->cfg + SFAX_PCI_ISAR; in setup_speedfax()
344 ASSIGN_FUNC(IND, ISAC, sf->isac); in setup_speedfax()
345 ASSIGN_FUNC(IND, ISAR, sf->isar); in setup_speedfax()
346 spin_lock_irqsave(&sf->lock, flags); in setup_speedfax()
347 reset_speedfax(sf); in setup_speedfax()
348 disable_hwirq(sf); in setup_speedfax()
349 spin_unlock_irqrestore(&sf->lock, flags); in setup_speedfax()