17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * This program is free software; you can redistribute it and/or 37c478bd9Sstevel@tonic-gate * modify it under the terms of the GNU General Public License as 47c478bd9Sstevel@tonic-gate * published by the Free Software Foundation; either version 2, or (at 57c478bd9Sstevel@tonic-gate * your option) any later version. 67c478bd9Sstevel@tonic-gate */ 77c478bd9Sstevel@tonic-gate 87c478bd9Sstevel@tonic-gate #ifndef NIC_H 97c478bd9Sstevel@tonic-gate #define NIC_H 107c478bd9Sstevel@tonic-gate 117c478bd9Sstevel@tonic-gate #include "dev.h" 127c478bd9Sstevel@tonic-gate 137c478bd9Sstevel@tonic-gate typedef enum { 147c478bd9Sstevel@tonic-gate DISABLE = 0, 157c478bd9Sstevel@tonic-gate ENABLE, 167c478bd9Sstevel@tonic-gate FORCE 177c478bd9Sstevel@tonic-gate } irq_action_t; 187c478bd9Sstevel@tonic-gate 197c478bd9Sstevel@tonic-gate /* 207c478bd9Sstevel@tonic-gate * Structure returned from eth_probe and passed to other driver 217c478bd9Sstevel@tonic-gate * functions. 227c478bd9Sstevel@tonic-gate */ 237c478bd9Sstevel@tonic-gate struct nic 247c478bd9Sstevel@tonic-gate { 257c478bd9Sstevel@tonic-gate struct dev dev; /* This must come first */ 267c478bd9Sstevel@tonic-gate int (*poll)P((struct nic *, int retrieve)); 277c478bd9Sstevel@tonic-gate void (*transmit)P((struct nic *, const char *d, 287c478bd9Sstevel@tonic-gate unsigned int t, unsigned int s, const char *p)); 297c478bd9Sstevel@tonic-gate void (*irq)P((struct nic *, irq_action_t)); 307c478bd9Sstevel@tonic-gate int flags; /* driver specific flags */ 317c478bd9Sstevel@tonic-gate struct rom_info *rom_info; /* -> rom_info from main */ 327c478bd9Sstevel@tonic-gate unsigned char *node_addr; 337c478bd9Sstevel@tonic-gate unsigned char *packet; 347c478bd9Sstevel@tonic-gate unsigned int packetlen; 357c478bd9Sstevel@tonic-gate unsigned int ioaddr; 367c478bd9Sstevel@tonic-gate unsigned char irqno; 377c478bd9Sstevel@tonic-gate void *priv_data; /* driver can hang private data here */ 387c478bd9Sstevel@tonic-gate }; 397c478bd9Sstevel@tonic-gate 407c478bd9Sstevel@tonic-gate extern int eth_probe(struct dev *dev); 417c478bd9Sstevel@tonic-gate extern int eth_poll(int retrieve); 427c478bd9Sstevel@tonic-gate extern void eth_transmit(const char *d, unsigned int t, unsigned int s, const void *p); 437c478bd9Sstevel@tonic-gate extern void eth_disable(void); 447c478bd9Sstevel@tonic-gate extern void eth_irq(irq_action_t action); 457c478bd9Sstevel@tonic-gate #endif /* NIC_H */ 46