Pike/0.6-stable/lib/modules/Tools.pmod /cvs er is your own creation, and give due credit to others * that contributed to the work. Remember that GNU project code * cannot use proprietary or trade secret information. Interface * definitions are generally considered non-copyrightable to the * extent that the same names and structures must be used to be * compatible. * * Finally, keep in mind that the Linux kernel is has an API, not * ABI. Proprietary object-code-only distributions are not permitted * under the GPL. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* * The name of the card. Is used for messages and in the requests for * io regions, irqs and dma channels */ static const char* cardname = "netcard"; /* First, a few definitions that the brave might change. */ /* A zero-terminated list of I/O addresses to be probed. */ static unsigned int netcard_portlist[] __initdata = { 0x200, 0x240, 0x280, 0x2C0, 0x300, 0x320, 0x340, 0}; /* use 0 for production, 1 for verification, >2 for debug */ #ifndef NET_DEBUG #define NET_DEBUG 2 #endif static unsigned int net_debug = NET_DEBUG; /* The number of low I/O ports used by the ethercard. */ #define NETCARD_IO_EXTENT 32 /* Information that need to be kept for each board. */ struct net_local { struct net_device_stats stats; long open_time; /* Useless example local info. */ }; /* The station (ethernet) address prefix, used for IDing the board. */ #define SA_ADDR0 0x00 #define SA_ADDR1 0x42 #define SA_ADDR2 0x65 /* Index to functions, as function prototypes. */ extern int netcard_probe(struct device *dev); static int netcard_probe1(struct device *dev, int ioaddr); static int net_open(struct device *dev); static int net_send_packet(struct sk_buff *skb, struct device *dev); static void net_interrupt(int irq, void *dev_id, struct pt_regs *regs); static void net_rx(struct device *dev); static int net_close(struct device *dev); static struct net_device_stats *net_get_stats(struct device *dev); static void set_multicast_list(struct device *dev); /* Example routines you must write ;->. */ #define tx_done(dev) 1 extern void hardware_send_packet(short ioaddr, char *buf, int length); extern void chipset_init(struct device *dev, int startp); /* * Check for a network adaptor of this type, and return '0' iff one