Style(9) xe(4). The MD5 sums are different, but comparing the dissassemblies
the only changes are from gcc moving some global variables around slightly.
This commit is contained in:
parent
14bf405be4
commit
214b852cd9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=179551
2854
sys/dev/xe/if_xe.c
2854
sys/dev/xe/if_xe.c
File diff suppressed because it is too large
Load Diff
@ -67,38 +67,37 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
extern int xe_debug;
|
||||
|
||||
#define DEVPRINTF(level, arg) if (xe_debug >= (level)) device_printf arg
|
||||
#define DPRINTF(level, arg) if (xe_debug >= (level)) printf arg
|
||||
#define DEVPRINTF(level, arg) if (xe_debug >= (level)) device_printf arg
|
||||
#define DPRINTF(level, arg) if (xe_debug >= (level)) printf arg
|
||||
#else
|
||||
#define DEVPRINTF(level, arg)
|
||||
#define DPRINTF(level, arg)
|
||||
#define DEVPRINTF(level, arg)
|
||||
#define DPRINTF(level, arg)
|
||||
#endif
|
||||
|
||||
|
||||
#define XE_CARD_TYPE_FLAGS_NO 0x0
|
||||
#define XE_CARD_TYPE_FLAGS_CE2 0x1
|
||||
#define XE_CARD_TYPE_FLAGS_MOHAWK 0x2
|
||||
#define XE_CARD_TYPE_FLAGS_DINGO 0x4
|
||||
#define XE_PROD_ETHER_MASK 0x0100
|
||||
#define XE_PROD_MODEM_MASK 0x1000
|
||||
#define XE_CARD_TYPE_FLAGS_NO 0x0
|
||||
#define XE_CARD_TYPE_FLAGS_CE2 0x1
|
||||
#define XE_CARD_TYPE_FLAGS_MOHAWK 0x2
|
||||
#define XE_CARD_TYPE_FLAGS_DINGO 0x4
|
||||
#define XE_PROD_ETHER_MASK 0x0100
|
||||
#define XE_PROD_MODEM_MASK 0x1000
|
||||
|
||||
#define XE_BOGUS_MAC_OFFSET 0x90
|
||||
#define XE_BOGUS_MAC_OFFSET 0x90
|
||||
|
||||
/* MAC vendor prefix used by most Xircom cards is 00:80:c7 */
|
||||
#define XE_MAC_ADDR_0 0x00
|
||||
#define XE_MAC_ADDR_1 0x80
|
||||
#define XE_MAC_ADDR_2 0xc7
|
||||
#define XE_MAC_ADDR_0 0x00
|
||||
#define XE_MAC_ADDR_1 0x80
|
||||
#define XE_MAC_ADDR_2 0xc7
|
||||
|
||||
/* Some (all?) REM56 cards have vendor prefix 00:10:a4 */
|
||||
#define XE_REM56_MAC_ADDR_0 0x00
|
||||
#define XE_REM56_MAC_ADDR_1 0x10
|
||||
#define XE_REM56_MAC_ADDR_2 0xa4
|
||||
|
||||
#define XE_REM56_MAC_ADDR_0 0x00
|
||||
#define XE_REM56_MAC_ADDR_1 0x10
|
||||
#define XE_REM56_MAC_ADDR_2 0xa4
|
||||
|
||||
struct xe_pccard_product {
|
||||
struct pccard_product product;
|
||||
uint16_t prodext;
|
||||
uint16_t flags;
|
||||
uint16_t prodext;
|
||||
uint16_t flags;
|
||||
};
|
||||
|
||||
static const struct xe_pccard_product xe_pccard_products[] = {
|
||||
@ -126,7 +125,6 @@ static const struct xe_pccard_product xe_pccard_products[] = {
|
||||
{ { NULL }, 0, 0 }
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Fixing for CEM2, CEM3 and CEM56/REM56 cards. These need some magic to
|
||||
* enable the Ethernet function, which isn't mentioned anywhere in the CIS.
|
||||
@ -135,7 +133,7 @@ static const struct xe_pccard_product xe_pccard_products[] = {
|
||||
static int
|
||||
xe_cemfix(device_t dev)
|
||||
{
|
||||
struct xe_softc *sc = (struct xe_softc *) device_get_softc(dev);
|
||||
struct xe_softc *sc = device_get_softc(dev);
|
||||
int ioport;
|
||||
|
||||
DEVPRINTF(2, (dev, "cemfix\n"));
|
||||
@ -164,7 +162,8 @@ xe_cemfix(device_t dev)
|
||||
}
|
||||
|
||||
static int
|
||||
xe_pccard_product_match(device_t dev, const struct pccard_product* ent, int vpfmatch)
|
||||
xe_pccard_product_match(device_t dev, const struct pccard_product* ent,
|
||||
int vpfmatch)
|
||||
{
|
||||
const struct xe_pccard_product* xpp;
|
||||
uint16_t prodext;
|
||||
@ -184,7 +183,7 @@ xe_pccard_product_match(device_t dev, const struct pccard_product* ent, int vpfm
|
||||
static const struct xe_pccard_product *
|
||||
xe_pccard_get_product(device_t dev)
|
||||
{
|
||||
return ((const struct xe_pccard_product *) pccard_product_lookup(dev,
|
||||
return ((const struct xe_pccard_product *)pccard_product_lookup(dev,
|
||||
(const struct pccard_product *)xe_pccard_products,
|
||||
sizeof(xe_pccard_products[0]), xe_pccard_product_match));
|
||||
}
|
||||
@ -237,7 +236,7 @@ xe_bad_mac(uint8_t *enaddr)
|
||||
static int
|
||||
xe_pccard_attach(device_t dev)
|
||||
{
|
||||
struct xe_softc *scp = (struct xe_softc *) device_get_softc(dev);
|
||||
struct xe_softc *scp = device_get_softc(dev);
|
||||
uint32_t vendor,product;
|
||||
uint16_t prodext;
|
||||
const char* vendor_str = NULL;
|
||||
|
@ -33,40 +33,40 @@
|
||||
* One of these structures per allocated device
|
||||
*/
|
||||
struct xe_softc {
|
||||
struct ifmedia ifmedia;
|
||||
struct ifmib_iso_8802_3 mibdata;
|
||||
struct callout media_timer;
|
||||
struct callout wdog_timer;
|
||||
int tx_timeout;
|
||||
struct mtx lock;
|
||||
struct ifnet *ifp;
|
||||
struct ifmedia *ifm;
|
||||
u_char enaddr[6];
|
||||
const char *card_type;/* Card model name */
|
||||
const char *vendor; /* Card manufacturer */
|
||||
device_t dev; /* Device */
|
||||
void *intrhand;
|
||||
struct resource *irq_res;
|
||||
int irq_rid;
|
||||
struct resource *port_res;
|
||||
int port_rid;
|
||||
struct resource *ce2_port_res;
|
||||
int ce2_port_rid;
|
||||
int srev; /* Silicon revision */
|
||||
int tx_queued; /* Packets currently waiting to transmit */
|
||||
int tx_tpr; /* Last value of TPR reg on card */
|
||||
int tx_timeouts; /* Count of transmit timeouts */
|
||||
u_int16_t tx_min; /* Smallest packet we can send without padding */
|
||||
u_int16_t tx_thres; /* Threshold bytes for early transmit */
|
||||
int autoneg_status; /* Autonegotiation progress state */
|
||||
int media; /* Private media word */
|
||||
u_char version; /* Bonding Version register from card */
|
||||
u_char modem; /* 1 = Card has a modem */
|
||||
u_char ce2; /* 1 = Card has CE2 silicon */
|
||||
u_char mohawk; /* 1 = Card has Mohawk (CE3) silicon */
|
||||
u_char dingo; /* 1 = Card has Dingo (CEM56) silicon */
|
||||
u_char phy_ok; /* 1 = MII-compliant PHY found and initialised */
|
||||
u_char gone; /* 1 = Card bailed out */
|
||||
struct ifmedia ifmedia;
|
||||
struct ifmib_iso_8802_3 mibdata;
|
||||
struct callout media_timer;
|
||||
struct callout wdog_timer;
|
||||
int tx_timeout;
|
||||
struct mtx lock;
|
||||
struct ifnet *ifp;
|
||||
struct ifmedia *ifm;
|
||||
u_char enaddr[ETHER_ADDR_LEN];
|
||||
const char *card_type; /* Card model name */
|
||||
const char *vendor; /* Card manufacturer */
|
||||
device_t dev; /* Device */
|
||||
void *intrhand;
|
||||
struct resource *irq_res;
|
||||
int irq_rid;
|
||||
struct resource *port_res;
|
||||
int port_rid;
|
||||
struct resource *ce2_port_res;
|
||||
int ce2_port_rid;
|
||||
int srev; /* Silicon revision */
|
||||
int tx_queued; /* Transmit packets currently waiting */
|
||||
int tx_tpr; /* Last value of TPR reg on card */
|
||||
int tx_timeouts; /* Count of transmit timeouts */
|
||||
uint16_t tx_min; /* Smallest packet for no padding */
|
||||
uint16_t tx_thres; /* Threshold bytes for early transmit */
|
||||
int autoneg_status; /* Autonegotiation progress state */
|
||||
int media; /* Private media word */
|
||||
u_char version; /* Bonding Version register from card */
|
||||
u_char modem; /* 1 = Card has a modem */
|
||||
u_char ce2; /* 1 = Card has CE2 silicon */
|
||||
u_char mohawk; /* 1 = Card has Mohawk (CE3) silicon */
|
||||
u_char dingo; /* 1 = Card has Dingo (CEM56) silicon */
|
||||
u_char phy_ok; /* 1 = MII-compliant PHY found */
|
||||
u_char gone; /* 1 = Card bailed out */
|
||||
};
|
||||
|
||||
#define XE_LOCK(sc) mtx_lock(&(sc)->lock)
|
||||
@ -76,15 +76,15 @@ struct xe_softc {
|
||||
/*
|
||||
* For accessing card registers
|
||||
*/
|
||||
#define XE_INB(r) bus_read_1(scp->port_res, (r))
|
||||
#define XE_INW(r) bus_read_2(scp->port_res, (r))
|
||||
#define XE_OUTB(r, b) bus_write_1(scp->port_res, (r), (b))
|
||||
#define XE_OUTW(r, w) bus_write_2(scp->port_res, (r), (w))
|
||||
#define XE_SELECT_PAGE(p) XE_OUTB(XE_PR, (p))
|
||||
#define XE_INB(r) bus_read_1(scp->port_res, (r))
|
||||
#define XE_INW(r) bus_read_2(scp->port_res, (r))
|
||||
#define XE_OUTB(r, b) bus_write_1(scp->port_res, (r), (b))
|
||||
#define XE_OUTW(r, w) bus_write_2(scp->port_res, (r), (w))
|
||||
#define XE_SELECT_PAGE(p) XE_OUTB(XE_PR, (p))
|
||||
|
||||
int xe_attach(device_t dev);
|
||||
int xe_activate(device_t dev);
|
||||
void xe_deactivate(device_t dev);
|
||||
void xe_stop(struct xe_softc *scp);
|
||||
int xe_attach(device_t dev);
|
||||
int xe_activate(device_t dev);
|
||||
void xe_deactivate(device_t dev);
|
||||
void xe_stop(struct xe_softc *scp);
|
||||
|
||||
#endif /* DEV_XE_IF_XEVAR_H */
|
||||
|
Loading…
Reference in New Issue
Block a user