NetBSD/sys/dev/pcmcia/if_xivar.h
mycroft 2d5fe6edb4 Split "xi" into a "xirc" frontend (similar to mhzc; it attaches two child
devices) and a "xi" backend.

My CE2 and CEM2 cards are now probed correctly.  However, there are still
some problems with one model of the CE2, and the CEM2 doesn't seem to get
any modem interrupts.

While I'm at it, fix several bugs:

* The tuple scan for the MAC address was broken in multiple ways.
* xi_intr() did not deal well with a shared interrupt.
* We were setting the wrong page number to look at the receive status.  (How
  did this work???)
* Remove the xi_full_reset() from xi_reset().  Move the parts of
  xi_full_reset() needed to undo the effect of xi_stop() into xi_init().  This
  allows a stop/init pair to DTRT, and much quicker, as used by various
  ioctl()s.
* Set the TRS register before reading the TSO register, as the Linux driver
  does.  While I'm at it, fix the name.
* Fix numerous problems with xi_set_address().  "Where do I begin?"  There's a
  chance that multicast works now, but I haven't tested it.
* Explicitly clear the MSR register, and also force SELECT_MII to 0 if we
  didn't find any PHYs.
* Clean up some cruft that appears to be bogus.

Probably needs more work, but it's a start.
2004-08-08 05:56:08 +00:00

57 lines
1.9 KiB
C

/* $NetBSD: if_xivar.h,v 1.1 2004/08/08 05:56:08 mycroft Exp $ */
/*
* Copyright (c) 2004 Charles M. Hannum. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Charles M. Hannum.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*/
#include "rnd.h"
#if NRND > 0
#include <sys/rnd.h>
#endif
struct xi_softc {
struct device sc_dev; /* Generic device info */
struct ethercom sc_ethercom; /* Ethernet common part */
struct mii_data sc_mii; /* MII media information */
bus_space_tag_t sc_bst; /* Bus cookie */
bus_space_handle_t sc_bsh; /* Bus I/O handle */
bus_size_t sc_offset; /* Offset of registers */
/* Power management hooks and state. */
int (*sc_enable) __P((struct xi_softc *));
void (*sc_disable) __P((struct xi_softc *));
int sc_enabled;
int sc_chipset; /* Chipset type */
#define XI_CHIPSET_SCIPPER 0
#define XI_CHIPSET_MOHAWK 1
#define XI_CHIPSET_DINGO 2
u_int8_t sc_rev; /* Chip revision */
#if NRND > 0
rndsource_element_t sc_rnd_source;
#endif
};
void xi_attach __P((struct xi_softc *, u_int8_t *));
int xi_detach __P((struct device *, int));
int xi_activate __P((struct device *, enum devact));
int xi_intr __P((void *));