Lines Matching refs:dev
65 int tms_isa_probe(struct net_device *dev);
66 static int tms_isa_open(struct net_device *dev);
67 static int tms_isa_close(struct net_device *dev);
68 static void tms_isa_read_eeprom(struct net_device *dev);
69 static unsigned short tms_isa_setnselout_pins(struct net_device *dev);
71 static unsigned short tms_isa_sifreadb(struct net_device *dev, unsigned short reg) in tms_isa_sifreadb() argument
73 return inb(dev->base_addr + reg); in tms_isa_sifreadb()
76 static unsigned short tms_isa_sifreadw(struct net_device *dev, unsigned short reg) in tms_isa_sifreadw() argument
78 return inw(dev->base_addr + reg); in tms_isa_sifreadw()
81 static void tms_isa_sifwriteb(struct net_device *dev, unsigned short val, unsigned short reg) in tms_isa_sifwriteb() argument
83 outb(val, dev->base_addr + reg); in tms_isa_sifwriteb()
86 static void tms_isa_sifwritew(struct net_device *dev, unsigned short val, unsigned short reg) in tms_isa_sifwritew() argument
88 outw(val, dev->base_addr + reg); in tms_isa_sifwritew()
92 struct net_device *dev; member
130 int __init tms_isa_probe(struct net_device *dev) in tms_isa_probe() argument
137 if(check_region(dev->base_addr, TMS_ISA_IO_EXTENT)) in tms_isa_probe()
140 if(tms_isa_probe1(dev->base_addr)) in tms_isa_probe()
148 if (!request_region(dev->base_addr, TMS_ISA_IO_EXTENT, isa_cardname)) in tms_isa_probe()
151 if (tmsdev_init(dev, ISA_MAX_ADDRESS, NULL)) in tms_isa_probe()
153 release_region(dev->base_addr, TMS_ISA_IO_EXTENT); in tms_isa_probe()
157 dev->base_addr &= ~3; in tms_isa_probe()
159 tms_isa_read_eeprom(dev); in tms_isa_probe()
161 printk("%s: Ring Station Address: ", dev->name); in tms_isa_probe()
162 printk("%2.2x", dev->dev_addr[0]); in tms_isa_probe()
164 printk(":%2.2x", dev->dev_addr[j]); in tms_isa_probe()
167 tp = (struct net_local *)dev->priv; in tms_isa_probe()
179 dev->open = tms_isa_open; in tms_isa_probe()
180 dev->stop = tms_isa_close; in tms_isa_probe()
182 if (dev->irq == 0) in tms_isa_probe()
186 dev->irq = irqlist[j]; in tms_isa_probe()
187 if (!request_irq(dev->irq, tms380tr_interrupt, 0, in tms_isa_probe()
188 isa_cardname, dev)) in tms_isa_probe()
194 printk("%s: AutoSelect no IRQ available\n", dev->name); in tms_isa_probe()
195 release_region(dev->base_addr, TMS_ISA_IO_EXTENT); in tms_isa_probe()
196 tmsdev_term(dev); in tms_isa_probe()
203 if (irqlist[j] == dev->irq) in tms_isa_probe()
208 dev->name, dev->irq); in tms_isa_probe()
209 release_region(dev->base_addr, TMS_ISA_IO_EXTENT); in tms_isa_probe()
210 tmsdev_term(dev); in tms_isa_probe()
213 if (request_irq(dev->irq, tms380tr_interrupt, 0, in tms_isa_probe()
214 isa_cardname, dev)) in tms_isa_probe()
217 dev->name, dev->irq); in tms_isa_probe()
218 release_region(dev->base_addr, TMS_ISA_IO_EXTENT); in tms_isa_probe()
219 tmsdev_term(dev); in tms_isa_probe()
224 if (dev->dma == 0) in tms_isa_probe()
228 dev->dma = dmalist[j]; in tms_isa_probe()
229 if (!request_dma(dev->dma, isa_cardname)) in tms_isa_probe()
235 printk("%s: AutoSelect no DMA available\n", dev->name); in tms_isa_probe()
236 release_region(dev->base_addr, TMS_ISA_IO_EXTENT); in tms_isa_probe()
237 free_irq(dev->irq, dev); in tms_isa_probe()
238 tmsdev_term(dev); in tms_isa_probe()
245 if (dmalist[j] == dev->dma) in tms_isa_probe()
250 dev->name, dev->dma); in tms_isa_probe()
251 release_region(dev->base_addr, TMS_ISA_IO_EXTENT); in tms_isa_probe()
252 free_irq(dev->irq, dev); in tms_isa_probe()
253 tmsdev_term(dev); in tms_isa_probe()
256 if (request_dma(dev->dma, isa_cardname)) in tms_isa_probe()
259 dev->name, dev->dma); in tms_isa_probe()
260 release_region(dev->base_addr, TMS_ISA_IO_EXTENT); in tms_isa_probe()
261 free_irq(dev->irq, dev); in tms_isa_probe()
262 tmsdev_term(dev); in tms_isa_probe()
268 dev->name, dev->base_addr, dev->irq, dev->dma); in tms_isa_probe()
270 if (register_trdev(dev) == 0) in tms_isa_probe()
275 unregister_trdev(dev); in tms_isa_probe()
276 release_region(dev->base_addr, TMS_ISA_IO_EXTENT); in tms_isa_probe()
277 free_irq(dev->irq, dev); in tms_isa_probe()
278 free_dma(dev->dma); in tms_isa_probe()
279 tmsdev_term(dev); in tms_isa_probe()
284 card->dev = dev; in tms_isa_probe()
288 printk("%s: register_trdev() returned non-zero.\n", dev->name); in tms_isa_probe()
289 release_region(dev->base_addr, TMS_ISA_IO_EXTENT); in tms_isa_probe()
290 free_irq(dev->irq, dev); in tms_isa_probe()
291 free_dma(dev->dma); in tms_isa_probe()
292 tmsdev_term(dev); in tms_isa_probe()
308 static void tms_isa_read_eeprom(struct net_device *dev) in tms_isa_read_eeprom() argument
313 tms_isa_sifwritew(dev, 0, SIFADX); in tms_isa_read_eeprom()
314 tms_isa_sifwritew(dev, 0, SIFADR); in tms_isa_read_eeprom()
317 dev->addr_len = 6; in tms_isa_read_eeprom()
319 dev->dev_addr[i] = tms_isa_sifreadw(dev, SIFINC) >> 8; in tms_isa_read_eeprom()
322 unsigned short tms_isa_setnselout_pins(struct net_device *dev) in tms_isa_setnselout_pins() argument
327 static int tms_isa_open(struct net_device *dev) in tms_isa_open() argument
329 struct net_local *tp = (struct net_local *)dev->priv; in tms_isa_open()
337 if(irqlist[i] == dev->irq) in tms_isa_open()
343 i = dev->dma - 5; in tms_isa_open()
349 oldval = tms_isa_sifreadb(dev, POSREG); in tms_isa_open()
353 tms_isa_sifwriteb(dev, val, POSREG); in tms_isa_open()
355 tms380tr_open(dev); in tms_isa_open()
360 static int tms_isa_close(struct net_device *dev) in tms_isa_close() argument
362 tms380tr_close(dev); in tms_isa_close()
384 struct net_device *dev; in init_module() local
394 dev = init_trdev(NULL, 0); in init_module()
395 if (!dev) in init_module()
398 dev->base_addr = io[i]; in init_module()
399 dev->irq = irq[i]; in init_module()
400 dev->dma = dma[i]; in init_module()
402 if (tms_isa_probe(dev)) in init_module()
404 unregister_netdev(dev); in init_module()
405 kfree(dev); in init_module()
418 dev = init_trdev(NULL, 0); in init_module()
419 if (!dev) in init_module()
422 dev->base_addr = portlist[i]; in init_module()
423 dev->irq = irq[num]; in init_module()
424 dev->dma = dma[num]; in init_module()
426 if (tms_isa_probe(dev)) in init_module()
428 unregister_netdev(dev); in init_module()
429 kfree(dev); in init_module()
445 struct net_device *dev; in cleanup_module() local
449 dev = tms_isa_card_list->dev; in cleanup_module()
451 unregister_netdev(dev); in cleanup_module()
452 release_region(dev->base_addr, TMS_ISA_IO_EXTENT); in cleanup_module()
453 free_irq(dev->irq, dev); in cleanup_module()
454 free_dma(dev->dma); in cleanup_module()
455 tmsdev_term(dev); in cleanup_module()
456 kfree(dev); in cleanup_module()