Lines Matching refs:sf

114 	struct sfax_hw	*sf = dev_id;  in IOFUNC_IND()  local
118 spin_lock(&sf->lock); in IOFUNC_IND()
119 val = inb(sf->cfg + TIGER_AUX_STATUS); in IOFUNC_IND()
121 spin_unlock(&sf->lock); in IOFUNC_IND()
124 sf->irqcnt++; in IOFUNC_IND()
125 val = ReadISAR_IND(sf, ISAR_IRQBIT); in IOFUNC_IND()
128 mISDNisar_irq(&sf->isar); in IOFUNC_IND()
129 val = ReadISAC_IND(sf, ISAC_ISTA); in IOFUNC_IND()
131 mISDNisac_irq(&sf->isac, val); in IOFUNC_IND()
132 val = ReadISAR_IND(sf, ISAR_IRQBIT); in IOFUNC_IND()
136 pr_debug("%s: %d irqloops cpu%d\n", sf->name, in IOFUNC_IND()
139 pr_notice("%s: %d IRQ LOOP cpu%d\n", sf->name, in IOFUNC_IND()
141 spin_unlock(&sf->lock); in IOFUNC_IND()
146 enable_hwirq(struct sfax_hw *sf) in enable_hwirq() argument
148 WriteISAC_IND(sf, ISAC_MASK, 0); in enable_hwirq()
149 WriteISAR_IND(sf, ISAR_IRQBIT, ISAR_IRQMSK); in enable_hwirq()
150 outb(SFAX_TIGER_IRQ_BIT, sf->cfg + TIGER_AUX_IRQMASK); in enable_hwirq()
154 disable_hwirq(struct sfax_hw *sf) in disable_hwirq() argument
156 WriteISAC_IND(sf, ISAC_MASK, 0xFF); in disable_hwirq()
157 WriteISAR_IND(sf, ISAR_IRQBIT, 0); in disable_hwirq()
158 outb(0, sf->cfg + TIGER_AUX_IRQMASK); in disable_hwirq()
162 reset_speedfax(struct sfax_hw *sf) in reset_speedfax() argument
165 pr_debug("%s: resetting card\n", sf->name); in reset_speedfax()
166 outb(TIGER_EXTERN_RESET_ON, sf->cfg + TIGER_RESET_ADDR); in reset_speedfax()
167 outb(SFAX_PCI_RESET_ON, sf->cfg + TIGER_AUX_DATA); in reset_speedfax()
169 outb(TIGER_EXTERN_RESET_OFF, sf->cfg + TIGER_RESET_ADDR); in reset_speedfax()
170 sf->aux_data = SFAX_PCI_RESET_OFF; in reset_speedfax()
171 outb(sf->aux_data, sf->cfg + TIGER_AUX_DATA); in reset_speedfax()
176 sfax_ctrl(struct sfax_hw *sf, u32 cmd, u_long arg) in sfax_ctrl() argument
182 reset_speedfax(sf); in sfax_ctrl()
186 sf->aux_data &= ~SFAX_LED1_BIT; in sfax_ctrl()
188 sf->aux_data &= ~SFAX_LED2_BIT; in sfax_ctrl()
189 outb(sf->aux_data, sf->cfg + TIGER_AUX_DATA); in sfax_ctrl()
193 sf->aux_data |= SFAX_LED1_BIT; in sfax_ctrl()
195 sf->aux_data |= SFAX_LED2_BIT; in sfax_ctrl()
196 outb(sf->aux_data, sf->cfg + TIGER_AUX_DATA); in sfax_ctrl()
200 sf->name, __func__, cmd, arg); in sfax_ctrl()
208 channel_ctrl(struct sfax_hw *sf, struct mISDN_ctrl_req *cq) in channel_ctrl() argument
222 ret = sf->isac.ctrl(&sf->isac, HW_TESTLOOP, cq->channel); in channel_ctrl()
225 ret = sf->isac.ctrl(&sf->isac, HW_TIMER3_VALUE, cq->p1); in channel_ctrl()
228 pr_info("%s: unknown Op %x\n", sf->name, cq->op); in channel_ctrl()
240 struct sfax_hw *sf = dch->hw; in sfax_dctrl() local
244 pr_debug("%s: cmd:%x %p\n", sf->name, cmd, arg); in sfax_dctrl()
249 err = sf->isac.open(&sf->isac, rq); in sfax_dctrl()
251 err = sf->isar.open(&sf->isar, rq); in sfax_dctrl()
255 pr_info("%s: cannot get module\n", sf->name); in sfax_dctrl()
258 pr_debug("%s: dev(%d) close from %p\n", sf->name, in sfax_dctrl()
263 err = channel_ctrl(sf, arg); in sfax_dctrl()
266 pr_debug("%s: unknown command %x\n", sf->name, cmd); in sfax_dctrl()
273 init_card(struct sfax_hw *sf) in init_card() argument
278 ret = request_irq(sf->irq, speedfax_irq, IRQF_SHARED, sf->name, sf); in init_card()
280 pr_info("%s: couldn't get interrupt %d\n", sf->name, sf->irq); in init_card()
284 spin_lock_irqsave(&sf->lock, flags); in init_card()
285 ret = sf->isac.init(&sf->isac); in init_card()
287 spin_unlock_irqrestore(&sf->lock, flags); in init_card()
289 sf->name, ret); in init_card()
292 enable_hwirq(sf); in init_card()
294 WriteISAC_IND(sf, ISAC_CMDR, 0x41); in init_card()
295 spin_unlock_irqrestore(&sf->lock, flags); in init_card()
298 pr_notice("%s: IRQ %d count %d\n", sf->name, in init_card()
299 sf->irq, sf->irqcnt); in init_card()
300 if (!sf->irqcnt) { in init_card()
302 sf->name, sf->irq, 3 - cnt); in init_card()
306 free_irq(sf->irq, sf); in init_card()
312 setup_speedfax(struct sfax_hw *sf) in setup_speedfax() argument
316 if (!request_region(sf->cfg, 256, sf->name)) { in setup_speedfax()
318 sf->name, sf->cfg, sf->cfg + 255); in setup_speedfax()
321 outb(0xff, sf->cfg); in setup_speedfax()
322 outb(0, sf->cfg); in setup_speedfax()
323 outb(0xdd, sf->cfg + TIGER_AUX_CTRL); in setup_speedfax()
324 outb(0, sf->cfg + TIGER_AUX_IRQMASK); in setup_speedfax()
326 sf->isac.type = IPAC_TYPE_ISAC; in setup_speedfax()
327 sf->p_isac.ale = sf->cfg + SFAX_PCI_ADDR; in setup_speedfax()
328 sf->p_isac.port = sf->cfg + SFAX_PCI_ISAC; in setup_speedfax()
329 sf->p_isar.ale = sf->cfg + SFAX_PCI_ADDR; in setup_speedfax()
330 sf->p_isar.port = sf->cfg + SFAX_PCI_ISAR; in setup_speedfax()
331 ASSIGN_FUNC(IND, ISAC, sf->isac); in setup_speedfax()
332 ASSIGN_FUNC(IND, ISAR, sf->isar); in setup_speedfax()
333 spin_lock_irqsave(&sf->lock, flags); in setup_speedfax()
334 reset_speedfax(sf); in setup_speedfax()
335 disable_hwirq(sf); in setup_speedfax()
336 spin_unlock_irqrestore(&sf->lock, flags); in setup_speedfax()