u_intNN_t -> uintNN_t
This commit is contained in:
parent
67b39d4957
commit
11b735f28a
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: i82596.c,v 1.6 2005/02/17 15:16:26 tsutsui Exp $ */
|
||||
/* $NetBSD: i82596.c,v 1.7 2005/02/18 22:39:31 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2003 Jochen Kunz.
|
||||
@ -39,7 +39,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: i82596.c,v 1.6 2005/02/17 15:16:26 tsutsui Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: i82596.c,v 1.7 2005/02/18 22:39:31 tsutsui Exp $");
|
||||
|
||||
/* autoconfig and device stuff */
|
||||
#include <sys/param.h>
|
||||
@ -97,13 +97,13 @@ static void iee_watchdog(struct ifnet *); /* timer routine */
|
||||
static void iee_drain(struct ifnet *); /* release resources */
|
||||
|
||||
/* internal helper functions */
|
||||
static void iee_cb_setup(struct iee_softc *, u_int32_t);
|
||||
static void iee_cb_setup(struct iee_softc *, uint32_t);
|
||||
|
||||
/*
|
||||
Things a MD frontend has to provide:
|
||||
|
||||
The functions via function pointers in the softc:
|
||||
int (*sc_iee_cmd)(struct iee_softc *sc, u_int32_t cmd);
|
||||
int (*sc_iee_cmd)(struct iee_softc *sc, uint32_t cmd);
|
||||
int (*sc_iee_reset)(struct iee_softc *sc);
|
||||
void (*sc_mediastatus)(struct ifnet *, struct ifmediareq *);
|
||||
int (*sc_mediachange)(struct ifnet *);
|
||||
@ -148,7 +148,7 @@ to a cache line if sc->sc_cl_align != 1.
|
||||
|
||||
An interrupt with iee_intr() as handler must be established.
|
||||
|
||||
Call void iee_attach(struct iee_softc *sc, u_int8_t *ether_address,
|
||||
Call void iee_attach(struct iee_softc *sc, uint8_t *ether_address,
|
||||
int *media, int nmedia, int defmedia); when everything is set up. First
|
||||
parameter is a pointer to the MI softc, ether_address is an array that
|
||||
contains the ethernet address. media is an array of the media types
|
||||
@ -408,7 +408,7 @@ a multicast list length of 0, thus disabling the multicast filter.
|
||||
A defered MCS is signaled via ((sc->sc_flags & IEE_WANT_MCAST) != 0)
|
||||
*/
|
||||
void
|
||||
iee_cb_setup(struct iee_softc *sc, u_int32_t cmd)
|
||||
iee_cb_setup(struct iee_softc *sc, uint32_t cmd)
|
||||
{
|
||||
struct iee_cb *cb = SC_CB(sc->sc_next_cb);
|
||||
struct ifnet *ifp = &sc->sc_ethercom.ec_if;
|
||||
@ -501,7 +501,7 @@ iee_cb_setup(struct iee_softc *sc, u_int32_t cmd)
|
||||
|
||||
|
||||
void
|
||||
iee_attach(struct iee_softc *sc, u_int8_t *eth_addr, int *media, int nmedia,
|
||||
iee_attach(struct iee_softc *sc, uint8_t *eth_addr, int *media, int nmedia,
|
||||
int defmedia)
|
||||
{
|
||||
struct ifnet *ifp = &sc->sc_ethercom.ec_if;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: i82596var.h,v 1.2 2005/02/17 14:56:37 tsutsui Exp $ */
|
||||
/* $NetBSD: i82596var.h,v 1.3 2005/02/18 22:39:31 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2003 Jochen Kunz.
|
||||
@ -41,37 +41,37 @@ enum i82596_types { I82596_UNKNOWN, I82596_DX, I82596_CA };
|
||||
|
||||
/* System Configuration Pointer */
|
||||
struct iee_scp {
|
||||
volatile u_int16_t scp_pad1;
|
||||
volatile u_int16_t scp_sysbus; /* Sysbus Byte */
|
||||
volatile u_int32_t scp_pad2;
|
||||
volatile u_int32_t scp_iscp_addr; /* Int. Sys. Conf. Pointer */
|
||||
volatile uint16_t scp_pad1;
|
||||
volatile uint16_t scp_sysbus; /* Sysbus Byte */
|
||||
volatile uint32_t scp_pad2;
|
||||
volatile uint32_t scp_iscp_addr; /* Int. Sys. Conf. Pointer */
|
||||
} __attribute__((__packed__));
|
||||
|
||||
|
||||
|
||||
/* Intermediate System Configuration Pointer */
|
||||
struct iee_iscp {
|
||||
volatile u_int16_t iscp_bussy; /* Even Word, bits 0..15 */
|
||||
volatile u_int16_t iscp_pad; /* Odd Word, bits 16..32 */
|
||||
volatile u_int32_t iscp_scb_addr; /* address of SCB */
|
||||
volatile uint16_t iscp_bussy; /* Even Word, bits 0..15 */
|
||||
volatile uint16_t iscp_pad; /* Odd Word, bits 16..32 */
|
||||
volatile uint32_t iscp_scb_addr; /* address of SCB */
|
||||
} __attribute__((__packed__));
|
||||
|
||||
|
||||
|
||||
/* System Control Block */
|
||||
struct iee_scb {
|
||||
volatile u_int16_t scb_status; /* Status Bits */
|
||||
volatile u_int16_t scb_cmd; /* Command Bits */
|
||||
volatile u_int32_t scb_cmd_blk_addr; /* Command Block Address */
|
||||
volatile u_int32_t scb_rfa_addr; /* Receive Frame Area Address */
|
||||
volatile u_int32_t scb_crc_err; /* CRC Errors */
|
||||
volatile u_int32_t scb_align_err; /* Alignment Errors */
|
||||
volatile u_int32_t scb_resource_err; /* Resource Errors [1] */
|
||||
volatile u_int32_t scb_overrun_err; /* Overrun Errors [1] */
|
||||
volatile u_int32_t scb_rcvcdt_err; /* RCVCDT Errors [1] */
|
||||
volatile u_int32_t scb_short_fr_err; /* Short Frame Errors */
|
||||
volatile u_int16_t scb_tt_off; /* Bus Throtle Off Timer */
|
||||
volatile u_int16_t scb_tt_on; /* Bus Throtle On Timer */
|
||||
volatile uint16_t scb_status; /* Status Bits */
|
||||
volatile uint16_t scb_cmd; /* Command Bits */
|
||||
volatile uint32_t scb_cmd_blk_addr; /* Command Block Address */
|
||||
volatile uint32_t scb_rfa_addr; /* Receive Frame Area Address */
|
||||
volatile uint32_t scb_crc_err; /* CRC Errors */
|
||||
volatile uint32_t scb_align_err; /* Alignment Errors */
|
||||
volatile uint32_t scb_resource_err; /* Resource Errors [1] */
|
||||
volatile uint32_t scb_overrun_err; /* Overrun Errors [1] */
|
||||
volatile uint32_t scb_rcvcdt_err; /* RCVCDT Errors [1] */
|
||||
volatile uint32_t scb_short_fr_err; /* Short Frame Errors */
|
||||
volatile uint16_t scb_tt_off; /* Bus Throtle Off Timer */
|
||||
volatile uint16_t scb_tt_on; /* Bus Throtle On Timer */
|
||||
} __attribute__((__packed__));
|
||||
/* [1] In MONITOR mode these counters change function. */
|
||||
|
||||
@ -79,26 +79,26 @@ struct iee_scb {
|
||||
|
||||
/* Command Block */
|
||||
struct iee_cb {
|
||||
volatile u_int16_t cb_status; /* Status Bits */
|
||||
volatile u_int16_t cb_cmd; /* Command Bits */
|
||||
volatile u_int32_t cb_link_addr; /* Link Address to next CMD */
|
||||
volatile uint16_t cb_status; /* Status Bits */
|
||||
volatile uint16_t cb_cmd; /* Command Bits */
|
||||
volatile uint32_t cb_link_addr; /* Link Address to next CMD */
|
||||
union {
|
||||
volatile u_int8_t cb_ind_addr[8];/* Individual Address */
|
||||
volatile u_int8_t cb_cf[16]; /* Configuration Bytes */
|
||||
volatile uint8_t cb_ind_addr[8];/* Individual Address */
|
||||
volatile uint8_t cb_cf[16]; /* Configuration Bytes */
|
||||
struct {
|
||||
volatile u_int16_t mc_size;/* Num bytes of Mcast Addr.*/
|
||||
volatile u_int8_t mc_addrs[6]; /* List of Mcast Addr. */
|
||||
volatile uint16_t mc_size;/* Num bytes of Mcast Addr.*/
|
||||
volatile uint8_t mc_addrs[6]; /* List of Mcast Addr. */
|
||||
} cb_mcast;
|
||||
struct {
|
||||
volatile u_int32_t tx_tbd_addr;/* TX Buf. Descr. Addr.*/
|
||||
volatile u_int16_t tx_tcb_count; /* Len. of opt. data */
|
||||
volatile u_int16_t tx_pad;
|
||||
volatile u_int8_t tx_dest_addr[6]; /* Dest. Addr. */
|
||||
volatile u_int16_t tx_length; /* Length of data */
|
||||
/* u_int8_t data; Data to send, optional */
|
||||
volatile uint32_t tx_tbd_addr;/* TX Buf. Descr. Addr.*/
|
||||
volatile uint16_t tx_tcb_count; /* Len. of opt. data */
|
||||
volatile uint16_t tx_pad;
|
||||
volatile uint8_t tx_dest_addr[6]; /* Dest. Addr. */
|
||||
volatile uint16_t tx_length; /* Length of data */
|
||||
/* uint8_t data; Data to send, optional */
|
||||
} cb_transmit;
|
||||
volatile u_int32_t cb_tdr; /* Time & Flags from TDR CMD */
|
||||
volatile u_int32_t cb_dump_addr;/* Address of Dump buffer */
|
||||
volatile uint32_t cb_tdr; /* Time & Flags from TDR CMD */
|
||||
volatile uint32_t cb_dump_addr; /* Address of Dump buffer */
|
||||
};
|
||||
} __attribute__((__packed__));
|
||||
|
||||
@ -106,38 +106,38 @@ struct iee_cb {
|
||||
|
||||
/* Transmit Buffer Descriptor */
|
||||
struct iee_tbd {
|
||||
volatile u_int16_t tbd_size; /* Size of buffer & Flags */
|
||||
volatile u_int16_t tbd_pad;
|
||||
volatile u_int32_t tbd_link_addr; /* Link Address to next RFD */
|
||||
volatile u_int32_t tbd_tb_addr; /* Transmit Buffer Address */
|
||||
volatile uint16_t tbd_size; /* Size of buffer & Flags */
|
||||
volatile uint16_t tbd_pad;
|
||||
volatile uint32_t tbd_link_addr; /* Link Address to next RFD */
|
||||
volatile uint32_t tbd_tb_addr; /* Transmit Buffer Address */
|
||||
} __attribute__((__packed__));
|
||||
|
||||
|
||||
|
||||
/* Receive Frame Descriptor */
|
||||
struct iee_rfd {
|
||||
volatile u_int16_t rfd_status; /* Status Bits */
|
||||
volatile u_int16_t rfd_cmd; /* Command Bits */
|
||||
volatile u_int32_t rfd_link_addr; /* Link Address to next RFD */
|
||||
volatile u_int32_t rfd_rbd_addr; /* Address of first free RBD */
|
||||
volatile u_int16_t rfd_count; /* Actual Count */
|
||||
volatile u_int16_t rfd_size; /* Size */
|
||||
volatile u_int8_t rfd_dest_addr[6]; /* Destiantion Address */
|
||||
volatile u_int8_t rfd_src_addr[6]; /* Source Address */
|
||||
volatile u_int16_t rfd_length; /* Length Field */
|
||||
volatile u_int16_t rfd_pad; /* Optional Data */
|
||||
volatile uint16_t rfd_status; /* Status Bits */
|
||||
volatile uint16_t rfd_cmd; /* Command Bits */
|
||||
volatile uint32_t rfd_link_addr; /* Link Address to next RFD */
|
||||
volatile uint32_t rfd_rbd_addr; /* Address of first free RBD */
|
||||
volatile uint16_t rfd_count; /* Actual Count */
|
||||
volatile uint16_t rfd_size; /* Size */
|
||||
volatile uint8_t rfd_dest_addr[6]; /* Destiantion Address */
|
||||
volatile uint8_t rfd_src_addr[6]; /* Source Address */
|
||||
volatile uint16_t rfd_length; /* Length Field */
|
||||
volatile uint16_t rfd_pad; /* Optional Data */
|
||||
} __attribute__((__packed__));
|
||||
|
||||
|
||||
|
||||
/* Receive Buffer Descriptor */
|
||||
struct iee_rbd {
|
||||
volatile u_int16_t rbd_count; /* Actual Cont of bytes */
|
||||
volatile u_int16_t rbd_pad1;
|
||||
volatile u_int32_t rbd_next_rbd; /* Address of Next RBD */
|
||||
volatile u_int32_t rbd_rb_addr; /* Receive Buffer Address */
|
||||
volatile u_int16_t rbd_size; /* Size of Receive Buffer */
|
||||
volatile u_int16_t rbd_pad2;
|
||||
volatile uint16_t rbd_count; /* Actual Cont of bytes */
|
||||
volatile uint16_t rbd_pad1;
|
||||
volatile uint32_t rbd_next_rbd; /* Address of Next RBD */
|
||||
volatile uint32_t rbd_rb_addr; /* Receive Buffer Address */
|
||||
volatile uint16_t rbd_size; /* Size of Receive Buffer */
|
||||
volatile uint16_t rbd_pad2;
|
||||
} __attribute__((__packed__));
|
||||
|
||||
|
||||
@ -164,22 +164,22 @@ struct iee_softc {
|
||||
int sc_next_cb;
|
||||
int sc_next_tbd;
|
||||
int sc_rx_done;
|
||||
u_int8_t sc_cf[14];
|
||||
uint8_t sc_cf[14];
|
||||
int sc_flags;
|
||||
int sc_cl_align;
|
||||
u_int32_t sc_crc_err;
|
||||
u_int32_t sc_align_err;
|
||||
u_int32_t sc_resource_err;
|
||||
u_int32_t sc_overrun_err;
|
||||
u_int32_t sc_rcvcdt_err;
|
||||
u_int32_t sc_short_fr_err;
|
||||
u_int32_t sc_receive_err;
|
||||
u_int32_t sc_tx_col;
|
||||
u_int32_t sc_rx_err;
|
||||
u_int32_t sc_cmd_err;
|
||||
u_int32_t sc_tx_timeout;
|
||||
u_int32_t sc_setup_timeout;
|
||||
int (*sc_iee_cmd)(struct iee_softc *, u_int32_t);
|
||||
uint32_t sc_crc_err;
|
||||
uint32_t sc_align_err;
|
||||
uint32_t sc_resource_err;
|
||||
uint32_t sc_overrun_err;
|
||||
uint32_t sc_rcvcdt_err;
|
||||
uint32_t sc_short_fr_err;
|
||||
uint32_t sc_receive_err;
|
||||
uint32_t sc_tx_col;
|
||||
uint32_t sc_rx_err;
|
||||
uint32_t sc_cmd_err;
|
||||
uint32_t sc_tx_timeout;
|
||||
uint32_t sc_setup_timeout;
|
||||
int (*sc_iee_cmd)(struct iee_softc *, uint32_t);
|
||||
int (*sc_iee_reset)(struct iee_softc *);
|
||||
void (*sc_mediastatus)(struct ifnet *, struct ifmediareq *);
|
||||
int (*sc_mediachange)(struct ifnet *);
|
||||
@ -193,7 +193,7 @@ struct iee_softc {
|
||||
|
||||
#define IEE_SWAP(x) ((sc->sc_flags & IEE_NEED_SWAP) == 0 ? x : \
|
||||
(((x) << 16) | ((x) >> 16)))
|
||||
#define IEE_PHYS_SHMEM(x) ((u_int32_t) (sc->sc_shmem_map->dm_segs[0].ds_addr \
|
||||
#define IEE_PHYS_SHMEM(x) ((uint32_t) (sc->sc_shmem_map->dm_segs[0].ds_addr \
|
||||
+ (x)))
|
||||
|
||||
|
||||
@ -253,7 +253,7 @@ struct iee_softc {
|
||||
|
||||
|
||||
|
||||
void iee_attach(struct iee_softc *, u_int8_t *, int *, int, int);
|
||||
void iee_attach(struct iee_softc *, uint8_t *, int *, int, int);
|
||||
void iee_detach(struct iee_softc *, int);
|
||||
int iee_intr(void *);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user