1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-04 09:09:56 +00:00

Use ANSI prototype to fix build with clang.

MFC after:	1 week
This commit is contained in:
Yoshihiro Takahashi 2012-11-10 14:58:06 +00:00
parent 2de04c22e5
commit 7a1cea226c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=242871
8 changed files with 119 additions and 297 deletions

View File

@ -78,9 +78,7 @@ typedef unsigned long vaddr_t;
* GENERIC MACHDEP FUNCTIONS * GENERIC MACHDEP FUNCTIONS
*********************************************************/ *********************************************************/
void void
bshw_synch_setup(ct, ti) bshw_synch_setup(struct ct_softc *ct, struct targ_info *ti)
struct ct_softc *ct;
struct targ_info *ti;
{ {
struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_bus_access_handle *chp = &ct->sc_ch;
struct ct_targ_info *cti = (void *) ti; struct ct_targ_info *cti = (void *) ti;
@ -99,8 +97,7 @@ bshw_synch_setup(ct, ti)
} }
void void
bshw_bus_reset(ct) bshw_bus_reset(struct ct_softc *ct)
struct ct_softc *ct;
{ {
struct scsi_low_softc *slp = &ct->sc_sclow; struct scsi_low_softc *slp = &ct->sc_sclow;
struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_bus_access_handle *chp = &ct->sc_ch;
@ -149,9 +146,7 @@ bshw_bus_reset(ct)
/* probe */ /* probe */
int int
bshw_read_settings(chp, bs) bshw_read_settings(struct ct_bus_access_handle *chp, struct bshw_softc *bs)
struct ct_bus_access_handle *chp;
struct bshw_softc *bs;
{ {
static int irq_tbl[] = { 3, 5, 6, 9, 12, 13 }; static int irq_tbl[] = { 3, 5, 6, 9, 12, 13 };
@ -183,8 +178,7 @@ static __inline void bshw_lc_smit_stop(struct ct_softc *);
static int bshw_lc_smit_fstat(struct ct_softc *, int, int); static int bshw_lc_smit_fstat(struct ct_softc *, int, int);
static __inline void static __inline void
bshw_lc_smit_stop(ct) bshw_lc_smit_stop(struct ct_softc *ct)
struct ct_softc *ct;
{ {
struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_bus_access_handle *chp = &ct->sc_ch;
@ -193,10 +187,7 @@ bshw_lc_smit_stop(ct)
} }
static __inline void static __inline void
bshw_lc_smit_start(ct, count, direction) bshw_lc_smit_start(struct ct_softc *ct, int count, u_int direction)
struct ct_softc *ct;
int count;
u_int direction;
{ {
struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_bus_access_handle *chp = &ct->sc_ch;
u_int8_t pval, val; u_int8_t pval, val;
@ -212,9 +203,7 @@ bshw_lc_smit_start(ct, count, direction)
} }
static int static int
bshw_lc_smit_fstat(ct, wc, read) bshw_lc_smit_fstat(struct ct_softc *ct, int wc, int read)
struct ct_softc *ct;
int wc, read;
{ {
struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_bus_access_handle *chp = &ct->sc_ch;
u_int8_t stat; u_int8_t stat;
@ -244,8 +233,7 @@ bshw_lc_smit_fstat(ct, wc, read)
} }
void void
bshw_smit_xfer_stop(ct) bshw_smit_xfer_stop(struct ct_softc *ct)
struct ct_softc *ct;
{ {
struct scsi_low_softc *slp = &ct->sc_sclow; struct scsi_low_softc *slp = &ct->sc_sclow;
struct bshw_softc *bs = ct->ct_hw; struct bshw_softc *bs = ct->ct_hw;
@ -292,8 +280,7 @@ bshw_smit_xfer_stop(ct)
} }
int int
bshw_smit_xfer_start(ct) bshw_smit_xfer_start(struct ct_softc *ct)
struct ct_softc *ct;
{ {
struct scsi_low_softc *slp = &ct->sc_sclow; struct scsi_low_softc *slp = &ct->sc_sclow;
struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_bus_access_handle *chp = &ct->sc_ch;
@ -396,8 +383,7 @@ static void bshw_dmastart(struct ct_softc *);
static void bshw_dmadone(struct ct_softc *); static void bshw_dmadone(struct ct_softc *);
int int
bshw_dma_xfer_start(ct) bshw_dma_xfer_start(struct ct_softc *ct)
struct ct_softc *ct;
{ {
struct scsi_low_softc *slp = &ct->sc_sclow; struct scsi_low_softc *slp = &ct->sc_sclow;
struct sc_p *sp = &slp->sl_scp; struct sc_p *sp = &slp->sl_scp;
@ -458,8 +444,7 @@ bshw_dma_xfer_start(ct)
} }
void void
bshw_dma_xfer_stop(ct) bshw_dma_xfer_stop(struct ct_softc *ct)
struct ct_softc *ct;
{ {
struct scsi_low_softc *slp = &ct->sc_sclow; struct scsi_low_softc *slp = &ct->sc_sclow;
struct sc_p *sp = &slp->sl_scp; struct sc_p *sp = &slp->sl_scp;
@ -523,10 +508,8 @@ bshw_dma_xfer_stop(ct)
static bus_addr_t dmapageport[4] = { 0x27, 0x21, 0x23, 0x25 }; static bus_addr_t dmapageport[4] = { 0x27, 0x21, 0x23, 0x25 };
static __inline void static __inline void
bshw_dma_write_1(chp, port, val) bshw_dma_write_1(struct ct_bus_access_handle *chp, bus_addr_t port,
struct ct_bus_access_handle *chp; u_int8_t val)
bus_addr_t port;
u_int8_t val;
{ {
CT_BUS_WEIGHT(chp); CT_BUS_WEIGHT(chp);
@ -534,8 +517,7 @@ bshw_dma_write_1(chp, port, val)
} }
static void static void
bshw_dmastart(ct) bshw_dmastart(struct ct_softc *ct)
struct ct_softc *ct;
{ {
struct scsi_low_softc *slp = &ct->sc_sclow; struct scsi_low_softc *slp = &ct->sc_sclow;
struct bshw_softc *bs = ct->ct_hw; struct bshw_softc *bs = ct->ct_hw;
@ -581,8 +563,7 @@ bshw_dmastart(ct)
} }
static void static void
bshw_dmadone(ct) bshw_dmadone(struct ct_softc *ct)
struct ct_softc *ct;
{ {
struct bshw_softc *bs = ct->ct_hw; struct bshw_softc *bs = ct->ct_hw;
struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_bus_access_handle *chp = &ct->sc_ch;
@ -609,8 +590,7 @@ static void bshw_dma_start_elecom(struct ct_softc *);
static void bshw_dma_stop_elecom(struct ct_softc *); static void bshw_dma_stop_elecom(struct ct_softc *);
static int static int
bshw_dma_init_texa(ct) bshw_dma_init_texa(struct ct_softc *ct)
struct ct_softc *ct;
{ {
struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_bus_access_handle *chp = &ct->sc_ch;
u_int8_t regval; u_int8_t regval;
@ -625,8 +605,7 @@ bshw_dma_init_texa(ct)
} }
static int static int
bshw_dma_init_sc98(ct) bshw_dma_init_sc98(struct ct_softc *ct)
struct ct_softc *ct;
{ {
struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_bus_access_handle *chp = &ct->sc_ch;
@ -652,8 +631,7 @@ bshw_dma_init_sc98(ct)
} }
static void static void
bshw_dma_start_sc98(ct) bshw_dma_start_sc98(struct ct_softc *ct)
struct ct_softc *ct;
{ {
struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_bus_access_handle *chp = &ct->sc_ch;
@ -662,8 +640,7 @@ bshw_dma_start_sc98(ct)
} }
static void static void
bshw_dma_stop_sc98(ct) bshw_dma_stop_sc98(struct ct_softc *ct)
struct ct_softc *ct;
{ {
struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_bus_access_handle *chp = &ct->sc_ch;
@ -672,8 +649,7 @@ bshw_dma_stop_sc98(ct)
} }
static void static void
bshw_dma_start_elecom(ct) bshw_dma_start_elecom(struct ct_softc *ct)
struct ct_softc *ct;
{ {
struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_bus_access_handle *chp = &ct->sc_ch;
u_int8_t tmp = ct_cr_read_1(chp, 0x4c); u_int8_t tmp = ct_cr_read_1(chp, 0x4c);
@ -682,8 +658,7 @@ bshw_dma_start_elecom(ct)
} }
static void static void
bshw_dma_stop_elecom(ct) bshw_dma_stop_elecom(struct ct_softc *ct)
struct ct_softc *ct;
{ {
struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_bus_access_handle *chp = &ct->sc_ch;
u_int8_t tmp = ct_cr_read_1(chp, 0x4c); u_int8_t tmp = ct_cr_read_1(chp, 0x4c);

View File

@ -164,9 +164,7 @@ struct scsi_low_funcs ct_funcs = {
* HW functions * HW functions
**************************************************/ **************************************************/
static __inline void static __inline void
cthw_phase_bypass(ct, ph) cthw_phase_bypass(struct ct_softc *ct, u_int8_t ph)
struct ct_softc *ct;
u_int8_t ph;
{ {
struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_bus_access_handle *chp = &ct->sc_ch;
@ -175,8 +173,7 @@ cthw_phase_bypass(ct, ph)
} }
static void static void
cthw_bus_reset(ct) cthw_bus_reset(struct ct_softc *ct)
struct ct_softc *ct;
{ {
/* /*
@ -187,10 +184,8 @@ cthw_bus_reset(ct)
} }
static int static int
cthw_chip_reset(chp, chiprevp, chipclk, hostid) cthw_chip_reset(struct ct_bus_access_handle *chp, int *chiprevp, int chipclk,
struct ct_bus_access_handle *chp; int hostid)
int *chiprevp;
int chipclk, hostid;
{ {
#define CT_SELTIMEOUT_20MHz_REGV (0x80) #define CT_SELTIMEOUT_20MHz_REGV (0x80)
u_int8_t aux, regv; u_int8_t aux, regv;
@ -285,8 +280,7 @@ cthw_chip_reset(chp, chiprevp, chipclk, hostid)
} }
static struct ct_synch_data * static struct ct_synch_data *
ct_make_synch_table(ct) ct_make_synch_table(struct ct_softc *ct)
struct ct_softc *ct;
{ {
struct ct_synch_data *sdtp, *sdp; struct ct_synch_data *sdtp, *sdp;
u_int base, i, period; u_int base, i, period;
@ -329,11 +323,8 @@ ct_make_synch_table(ct)
* Attach & Probe * Attach & Probe
**************************************************/ **************************************************/
int int
ctprobesubr(chp, dvcfg, hsid, chipclk, chiprevp) ctprobesubr(struct ct_bus_access_handle *chp, u_int dvcfg, int hsid,
struct ct_bus_access_handle *chp; u_int chipclk, int *chiprevp)
u_int dvcfg, chipclk;
int hsid;
int *chiprevp;
{ {
#if 0 #if 0
@ -346,8 +337,7 @@ ctprobesubr(chp, dvcfg, hsid, chipclk, chiprevp)
} }
void void
ctattachsubr(ct) ctattachsubr(struct ct_softc *ct)
struct ct_softc *ct;
{ {
struct scsi_low_softc *slp = &ct->sc_sclow; struct scsi_low_softc *slp = &ct->sc_sclow;
@ -362,8 +352,7 @@ ctattachsubr(ct)
* SCSI LOW interface functions * SCSI LOW interface functions
**************************************************/ **************************************************/
static void static void
cthw_attention(ct) cthw_attention(struct ct_softc *ct)
struct ct_softc *ct;
{ {
struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_bus_access_handle *chp = &ct->sc_ch;
@ -380,8 +369,7 @@ cthw_attention(ct)
} }
static void static void
ct_attention(ct) ct_attention(struct ct_softc *ct)
struct ct_softc *ct;
{ {
struct scsi_low_softc *slp = &ct->sc_sclow; struct scsi_low_softc *slp = &ct->sc_sclow;
@ -398,10 +386,7 @@ ct_attention(ct)
} }
static int static int
ct_targ_init(ct, ti, action) ct_targ_init(struct ct_softc *ct, struct targ_info *ti, int action)
struct ct_softc *ct;
struct targ_info *ti;
int action;
{ {
struct ct_targ_info *cti = (void *) ti; struct ct_targ_info *cti = (void *) ti;
@ -438,9 +423,7 @@ ct_targ_init(ct, ti, action)
} }
static int static int
ct_world_start(ct, fdone) ct_world_start(struct ct_softc *ct, int fdone)
struct ct_softc *ct;
int fdone;
{ {
struct scsi_low_softc *slp = &ct->sc_sclow; struct scsi_low_softc *slp = &ct->sc_sclow;
struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_bus_access_handle *chp = &ct->sc_ch;
@ -470,9 +453,7 @@ ct_world_start(ct, fdone)
} }
static int static int
ct_start_selection(ct, cb) ct_start_selection(struct ct_softc *ct, struct slccb *cb)
struct ct_softc *ct;
struct slccb *cb;
{ {
struct scsi_low_softc *slp = &ct->sc_sclow; struct scsi_low_softc *slp = &ct->sc_sclow;
struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_bus_access_handle *chp = &ct->sc_ch;
@ -544,10 +525,7 @@ ct_start_selection(ct, cb)
} }
static int static int
ct_msg(ct, ti, msg) ct_msg(struct ct_softc *ct, struct targ_info *ti, u_int msg)
struct ct_softc *ct;
struct targ_info *ti;
u_int msg;
{ {
struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_bus_access_handle *chp = &ct->sc_ch;
struct ct_targ_info *cti = (void *) ti; struct ct_targ_info *cti = (void *) ti;
@ -599,11 +577,8 @@ ct_msg(ct, ti, msg)
* <DATA PHASE> * <DATA PHASE>
*************************************************/ *************************************************/
static int static int
ct_xfer(ct, data, len, direction, statp) ct_xfer(struct ct_softc *ct, u_int8_t *data, int len, int direction,
struct ct_softc *ct; u_int *statp)
u_int8_t *data;
int len, direction;
u_int *statp;
{ {
struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_bus_access_handle *chp = &ct->sc_ch;
int wc; int wc;
@ -663,8 +638,7 @@ ct_xfer(ct, data, len, direction, statp)
#define CT_PADDING_BUF_SIZE 32 #define CT_PADDING_BUF_SIZE 32
static void static void
ct_io_xfer(ct) ct_io_xfer(struct ct_softc *ct)
struct ct_softc *ct;
{ {
struct scsi_low_softc *slp = &ct->sc_sclow; struct scsi_low_softc *slp = &ct->sc_sclow;
struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_bus_access_handle *chp = &ct->sc_ch;
@ -716,9 +690,7 @@ struct ct_err ct_cmderr[] = {
}; };
static void static void
ct_phase_error(ct, scsi_status) ct_phase_error(struct ct_softc *ct, u_int8_t scsi_status)
struct ct_softc *ct;
u_int8_t scsi_status;
{ {
struct scsi_low_softc *slp = &ct->sc_sclow; struct scsi_low_softc *slp = &ct->sc_sclow;
struct targ_info *ti = slp->sl_Tnexus; struct targ_info *ti = slp->sl_Tnexus;
@ -764,9 +736,7 @@ ct_phase_error(ct, scsi_status)
* ### SCSI PHASE SEQUENCER ### * ### SCSI PHASE SEQUENCER ###
**************************************************/ **************************************************/
static int static int
ct_reselected(ct, scsi_status) ct_reselected(struct ct_softc *ct, u_int8_t scsi_status)
struct ct_softc *ct;
u_int8_t scsi_status;
{ {
struct scsi_low_softc *slp = &ct->sc_sclow; struct scsi_low_softc *slp = &ct->sc_sclow;
struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_bus_access_handle *chp = &ct->sc_ch;
@ -809,9 +779,7 @@ ct_reselected(ct, scsi_status)
} }
static int static int
ct_target_nexus_establish(ct, lun, dir) ct_target_nexus_establish(struct ct_softc *ct, int lun, int dir)
struct ct_softc *ct;
int lun, dir;
{ {
struct scsi_low_softc *slp = &ct->sc_sclow; struct scsi_low_softc *slp = &ct->sc_sclow;
struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_bus_access_handle *chp = &ct->sc_ch;
@ -831,8 +799,7 @@ ct_target_nexus_establish(ct, lun, dir)
} }
static int static int
ct_lun_nexus_establish(ct) ct_lun_nexus_establish(struct ct_softc *ct)
struct ct_softc *ct;
{ {
struct scsi_low_softc *slp = &ct->sc_sclow; struct scsi_low_softc *slp = &ct->sc_sclow;
struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_bus_access_handle *chp = &ct->sc_ch;
@ -843,8 +810,7 @@ ct_lun_nexus_establish(ct)
} }
static int static int
ct_ccb_nexus_establish(ct) ct_ccb_nexus_establish(struct ct_softc *ct)
struct ct_softc *ct;
{ {
struct scsi_low_softc *slp = &ct->sc_sclow; struct scsi_low_softc *slp = &ct->sc_sclow;
struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_bus_access_handle *chp = &ct->sc_ch;
@ -870,8 +836,7 @@ ct_ccb_nexus_establish(ct)
} }
static int static int
ct_unbusy(ct) ct_unbusy(struct ct_softc *ct)
struct ct_softc *ct;
{ {
struct scsi_low_softc *slp = &ct->sc_sclow; struct scsi_low_softc *slp = &ct->sc_sclow;
struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_bus_access_handle *chp = &ct->sc_ch;
@ -894,8 +859,7 @@ ct_unbusy(ct)
} }
static int static int
ct_catch_intr(ct) ct_catch_intr(struct ct_softc *ct)
struct ct_softc *ct;
{ {
struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_bus_access_handle *chp = &ct->sc_ch;
int wc; int wc;
@ -913,8 +877,7 @@ ct_catch_intr(ct)
} }
int int
ctintr(arg) ctintr(void *arg)
void *arg;
{ {
struct ct_softc *ct = arg; struct ct_softc *ct = arg;
struct scsi_low_softc *slp = &ct->sc_sclow; struct scsi_low_softc *slp = &ct->sc_sclow;

View File

@ -367,16 +367,14 @@ ct_dmamap(void *arg, bus_dma_segment_t *seg, int nseg, int error)
} }
static void static void
ct_isa_bus_access_weight(chp) ct_isa_bus_access_weight(struct ct_bus_access_handle *chp)
struct ct_bus_access_handle *chp;
{ {
outb(0x5f, 0); outb(0x5f, 0);
} }
static void static void
ct_isa_dmasync_before(ct) ct_isa_dmasync_before(struct ct_softc *ct)
struct ct_softc *ct;
{ {
if (need_pre_dma_flush) if (need_pre_dma_flush)
@ -384,8 +382,7 @@ ct_isa_dmasync_before(ct)
} }
static void static void
ct_isa_dmasync_after(ct) ct_isa_dmasync_after(struct ct_softc *ct)
struct ct_softc *ct;
{ {
if (need_post_dma_flush) if (need_post_dma_flush)

View File

@ -90,8 +90,7 @@ static __inline void cthw_set_count
(struct ct_bus_access_handle *, u_int); (struct ct_bus_access_handle *, u_int);
static __inline u_int8_t static __inline u_int8_t
ct_stat_read_1(chp) ct_stat_read_1(struct ct_bus_access_handle *chp)
struct ct_bus_access_handle *chp;
{ {
u_int8_t regv; u_int8_t regv;
@ -101,9 +100,7 @@ ct_stat_read_1(chp)
} }
static __inline void static __inline void
cthw_set_count(chp, count) cthw_set_count(struct ct_bus_access_handle *chp, u_int count)
struct ct_bus_access_handle *chp;
u_int count;
{ {
bus_space_tag_t bst = chp->ch_iot; bus_space_tag_t bst = chp->ch_iot;
bus_space_handle_t bsh = chp->ch_ioh; bus_space_handle_t bsh = chp->ch_ioh;
@ -119,8 +116,7 @@ cthw_set_count(chp, count)
} }
static __inline u_int static __inline u_int
cthw_get_count(chp) cthw_get_count(struct ct_bus_access_handle *chp)
struct ct_bus_access_handle *chp;
{ {
bus_space_tag_t bst = chp->ch_iot; bus_space_tag_t bst = chp->ch_iot;
bus_space_handle_t bsh = chp->ch_ioh; bus_space_handle_t bsh = chp->ch_ioh;
@ -138,10 +134,7 @@ cthw_get_count(chp)
} }
static __inline void static __inline void
ct_write_cmds(chp, cmd, len) ct_write_cmds(struct ct_bus_access_handle *chp, u_int8_t *cmd, int len)
struct ct_bus_access_handle *chp;
u_int8_t *cmd;
int len;
{ {
bus_space_tag_t bst = chp->ch_iot; bus_space_tag_t bst = chp->ch_iot;
bus_space_handle_t bsh = chp->ch_ioh; bus_space_handle_t bsh = chp->ch_ioh;
@ -157,9 +150,7 @@ ct_write_cmds(chp, cmd, len)
} }
static __inline u_int8_t static __inline u_int8_t
ct_cr_read_1(chp, offs) ct_cr_read_1(struct ct_bus_access_handle *chp, bus_addr_t offs)
struct ct_bus_access_handle *chp;
bus_addr_t offs;
{ {
bus_space_tag_t bst = chp->ch_iot; bus_space_tag_t bst = chp->ch_iot;
bus_space_handle_t bsh = chp->ch_ioh; bus_space_handle_t bsh = chp->ch_ioh;
@ -173,10 +164,7 @@ ct_cr_read_1(chp, offs)
} }
static __inline void static __inline void
ct_cr_write_1(chp, offs, val) ct_cr_write_1(struct ct_bus_access_handle *chp, bus_addr_t offs, u_int8_t val)
struct ct_bus_access_handle *chp;
bus_addr_t offs;
u_int8_t val;
{ {
bus_space_tag_t bst = chp->ch_iot; bus_space_tag_t bst = chp->ch_iot;
bus_space_handle_t bsh = chp->ch_ioh; bus_space_handle_t bsh = chp->ch_ioh;
@ -188,8 +176,7 @@ ct_cr_write_1(chp, offs, val)
} }
static __inline u_int8_t static __inline u_int8_t
ct_cmdp_read_1(chp) ct_cmdp_read_1(struct ct_bus_access_handle *chp)
struct ct_bus_access_handle *chp;
{ {
u_int8_t regv; u_int8_t regv;
@ -199,9 +186,7 @@ ct_cmdp_read_1(chp)
} }
static __inline void static __inline void
ct_cmdp_write_1(chp, val) ct_cmdp_write_1(struct ct_bus_access_handle *chp, u_int8_t val)
struct ct_bus_access_handle *chp;
u_int8_t val;
{ {
bus_space_write_1(chp->ch_iot, chp->ch_ioh, cmd_port, val); bus_space_write_1(chp->ch_iot, chp->ch_ioh, cmd_port, val);

View File

@ -142,10 +142,8 @@ int sncdebug = 0;
int int
sncconfig(sc, media, nmedia, defmedia, myea) sncconfig(struct snc_softc *sc, int *media, int nmedia, int defmedia,
struct snc_softc *sc; u_int8_t *myea)
int *media, nmedia, defmedia;
u_int8_t *myea;
{ {
struct ifnet *ifp; struct ifnet *ifp;
int i; int i;
@ -195,8 +193,7 @@ sncconfig(sc, media, nmedia, defmedia, myea)
} }
void void
sncshutdown(arg) sncshutdown(void *arg)
void *arg;
{ {
struct snc_softc *sc = arg; struct snc_softc *sc = arg;
@ -208,8 +205,7 @@ sncshutdown(arg)
* Media change callback. * Media change callback.
*/ */
int int
snc_mediachange(ifp) snc_mediachange(struct ifnet *ifp)
struct ifnet *ifp;
{ {
struct snc_softc *sc = ifp->if_softc; struct snc_softc *sc = ifp->if_softc;
int error; int error;
@ -227,9 +223,7 @@ snc_mediachange(ifp)
* Media status callback. * Media status callback.
*/ */
void void
snc_mediastatus(ifp, ifmr) snc_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr)
struct ifnet *ifp;
struct ifmediareq *ifmr;
{ {
struct snc_softc *sc = ifp->if_softc; struct snc_softc *sc = ifp->if_softc;
@ -248,10 +242,7 @@ snc_mediastatus(ifp, ifmr)
static int static int
sncioctl(ifp, cmd, data) sncioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
struct ifnet *ifp;
u_long cmd;
caddr_t data;
{ {
struct ifreq *ifr; struct ifreq *ifr;
struct snc_softc *sc = ifp->if_softc; struct snc_softc *sc = ifp->if_softc;
@ -317,8 +308,7 @@ sncioctl(ifp, cmd, data)
* Encapsulate a packet of type family for the local net. * Encapsulate a packet of type family for the local net.
*/ */
static void static void
sncstart(ifp) sncstart(struct ifnet *ifp)
struct ifnet *ifp;
{ {
struct snc_softc *sc = ifp->if_softc; struct snc_softc *sc = ifp->if_softc;
@ -328,8 +318,7 @@ sncstart(ifp)
} }
static void static void
sncstart_locked(ifp) sncstart_locked(struct ifnet *ifp)
struct ifnet *ifp;
{ {
struct snc_softc *sc = ifp->if_softc; struct snc_softc *sc = ifp->if_softc;
struct mbuf *m; struct mbuf *m;
@ -390,16 +379,14 @@ sncstart_locked(ifp)
* hardware/software errors. * hardware/software errors.
*/ */
static void static void
sncreset(sc) sncreset(struct snc_softc *sc)
struct snc_softc *sc;
{ {
sncstop(sc); sncstop(sc);
sncinit_locked(sc); sncinit_locked(sc);
} }
static void static void
sncinit(xsc) sncinit(void *xsc)
void *xsc;
{ {
struct snc_softc *sc = xsc; struct snc_softc *sc = xsc;
@ -476,8 +463,7 @@ sncinit_locked(struct snc_softc *sc)
* part way through. * part way through.
*/ */
static int static int
sncstop(sc) sncstop(struct snc_softc *sc)
struct snc_softc *sc;
{ {
struct mtd *mtd; struct mtd *mtd;
@ -536,10 +522,7 @@ sncwatchdog(void *arg)
* stuff packet into sonic * stuff packet into sonic
*/ */
static u_int static u_int
sonicput(sc, m0, mtd_next) sonicput(struct snc_softc *sc, struct mbuf *m0, int mtd_next)
struct snc_softc *sc;
struct mbuf *m0;
int mtd_next;
{ {
struct mtd *mtdp; struct mtd *mtdp;
struct mbuf *m; struct mbuf *m;
@ -629,8 +612,7 @@ sonicput(sc, m0, mtd_next)
* CAM support * CAM support
*/ */
static void static void
caminitialise(sc) caminitialise(struct snc_softc *sc)
struct snc_softc *sc;
{ {
u_int32_t v_cda = sc->v_cda; u_int32_t v_cda = sc->v_cda;
int i; int i;
@ -653,10 +635,7 @@ caminitialise(sc)
} }
static void static void
camentry(sc, entry, ea) camentry(struct snc_softc *sc, int entry, u_char *ea)
int entry;
u_char *ea;
struct snc_softc *sc;
{ {
u_int32_t v_cda = sc->v_cda; u_int32_t v_cda = sc->v_cda;
int camoffset = entry * CDA_CAMDESC; int camoffset = entry * CDA_CAMDESC;
@ -670,8 +649,7 @@ camentry(sc, entry, ea)
} }
static void static void
camprogram(sc) camprogram(struct snc_softc *sc)
struct snc_softc *sc;
{ {
struct ifmultiaddr *ifma; struct ifmultiaddr *ifma;
struct ifnet *ifp; struct ifnet *ifp;
@ -732,8 +710,7 @@ camprogram(sc)
#ifdef SNCDEBUG #ifdef SNCDEBUG
static void static void
camdump(sc) camdump(struct snc_softc *sc)
struct snc_softc *sc;
{ {
int i; int i;
@ -758,8 +735,7 @@ camdump(sc)
#endif #endif
static void static void
initialise_tda(sc) initialise_tda(struct snc_softc *sc)
struct snc_softc *sc;
{ {
struct mtd *mtd; struct mtd *mtd;
int i; int i;
@ -780,8 +756,7 @@ initialise_tda(sc)
} }
static void static void
initialise_rda(sc) initialise_rda(struct snc_softc *sc)
struct snc_softc *sc;
{ {
int i; int i;
u_int32_t vv_rda = 0; u_int32_t vv_rda = 0;
@ -809,8 +784,7 @@ initialise_rda(sc)
} }
static void static void
initialise_rra(sc) initialise_rra(struct snc_softc *sc)
struct snc_softc *sc;
{ {
int i; int i;
u_int v; u_int v;
@ -842,8 +816,7 @@ initialise_rra(sc)
} }
void void
sncintr(arg) sncintr(void *arg)
void *arg;
{ {
struct snc_softc *sc = (struct snc_softc *)arg; struct snc_softc *sc = (struct snc_softc *)arg;
int isr; int isr;
@ -912,8 +885,7 @@ sncintr(arg)
* Transmit interrupt routine * Transmit interrupt routine
*/ */
static void static void
sonictxint(sc) sonictxint(struct snc_softc *sc)
struct snc_softc *sc;
{ {
struct mtd *mtd; struct mtd *mtd;
u_int32_t txp; u_int32_t txp;
@ -990,8 +962,7 @@ sonictxint(sc)
* Receive interrupt routine * Receive interrupt routine
*/ */
static void static void
sonicrxint(sc) sonicrxint(struct snc_softc *sc)
struct snc_softc *sc;
{ {
u_int32_t rda; u_int32_t rda;
int orra; int orra;
@ -1084,10 +1055,7 @@ sonicrxint(sc)
* appropriate protocol handler * appropriate protocol handler
*/ */
static int static int
sonic_read(sc, pkt, len) sonic_read(struct snc_softc *sc, u_int32_t pkt, int len)
struct snc_softc *sc;
u_int32_t pkt;
int len;
{ {
struct ifnet *ifp = sc->sc_ifp; struct ifnet *ifp = sc->sc_ifp;
struct ether_header *et; struct ether_header *et;
@ -1131,10 +1099,7 @@ sonic_read(sc, pkt, len)
* munge the received packet into an mbuf chain * munge the received packet into an mbuf chain
*/ */
static struct mbuf * static struct mbuf *
sonic_get(sc, pkt, datalen) sonic_get(struct snc_softc *sc, u_int32_t pkt, int datalen)
struct snc_softc *sc;
u_int32_t pkt;
int datalen;
{ {
struct mbuf *m, *top, **mp; struct mbuf *m, *top, **mp;
int len; int len;
@ -1194,8 +1159,7 @@ sonic_get(sc, pkt, datalen)
* Enable power on the interface. * Enable power on the interface.
*/ */
int int
snc_enable(sc) snc_enable(struct snc_softc *sc)
struct snc_softc *sc;
{ {
#ifdef SNCDEBUG #ifdef SNCDEBUG
@ -1217,8 +1181,7 @@ snc_enable(sc)
* Disable power on the interface. * Disable power on the interface.
*/ */
void void
snc_disable(sc) snc_disable(struct snc_softc *sc)
struct snc_softc *sc;
{ {
#ifdef SNCDEBUG #ifdef SNCDEBUG

View File

@ -73,9 +73,7 @@ static __inline u_int16_t snc_nec16_select_bank
* to accept packets. * to accept packets.
*/ */
int int
sncsetup(sc, lladdr) sncsetup(struct snc_softc *sc, u_int8_t *lladdr)
struct snc_softc *sc;
u_int8_t *lladdr;
{ {
u_int32_t p, pp; u_int32_t p, pp;
int i; int i;
@ -172,8 +170,7 @@ sncsetup(sc, lladdr)
* check if a specified irq is acceptable. * check if a specified irq is acceptable.
*/ */
u_int8_t u_int8_t
snc_nec16_validate_irq(irq) snc_nec16_validate_irq(int irq)
int irq;
{ {
const u_int8_t encoded_irq[16] = { const u_int8_t encoded_irq[16] = {
-1, -1, -1, 0, -1, 1, 2, -1, -1, 3, 4, -1, 5, 6, -1, -1 -1, -1, -1, 0, -1, 1, 2, -1, -1, 3, 4, -1, 5, 6, -1, -1
@ -186,9 +183,7 @@ snc_nec16_validate_irq(irq)
* specify irq to board. * specify irq to board.
*/ */
int int
snc_nec16_register_irq(sc, irq) snc_nec16_register_irq(struct snc_softc *sc, int irq)
struct snc_softc *sc;
int irq;
{ {
bus_space_tag_t iot = sc->sc_iot; bus_space_tag_t iot = sc->sc_iot;
bus_space_handle_t ioh = sc->sc_ioh; bus_space_handle_t ioh = sc->sc_ioh;
@ -212,8 +207,7 @@ snc_nec16_register_irq(sc, irq)
* check if a specified memory base address is acceptable. * check if a specified memory base address is acceptable.
*/ */
int int
snc_nec16_validate_mem(maddr) snc_nec16_validate_mem(int maddr)
int maddr;
{ {
/* Check on Normal mode with max range, only */ /* Check on Normal mode with max range, only */
@ -230,9 +224,7 @@ snc_nec16_validate_mem(maddr)
* specify memory base address to board and map to first bank. * specify memory base address to board and map to first bank.
*/ */
int int
snc_nec16_register_mem(sc, maddr) snc_nec16_register_mem(struct snc_softc *sc, int maddr)
struct snc_softc *sc;
int maddr;
{ {
bus_space_tag_t iot = sc->sc_iot; bus_space_tag_t iot = sc->sc_iot;
bus_space_handle_t ioh = sc->sc_ioh; bus_space_handle_t ioh = sc->sc_ioh;
@ -260,11 +252,8 @@ snc_nec16_register_mem(sc, maddr)
} }
int int
snc_nec16_check_memory(iot, ioh, memt, memh) snc_nec16_check_memory(bus_space_tag_t iot, bus_space_handle_t ioh,
bus_space_tag_t iot; bus_space_tag_t memt, bus_space_handle_t memh)
bus_space_handle_t ioh;
bus_space_tag_t memt;
bus_space_handle_t memh;
{ {
u_int16_t val; u_int16_t val;
int i, j; int i, j;
@ -341,14 +330,9 @@ snc_nec16_check_memory(iot, ioh, memt, memh)
} }
int int
snc_nec16_detectsubr(iot, ioh, memt, memh, irq, maddr, type) snc_nec16_detectsubr(bus_space_tag_t iot, bus_space_handle_t ioh,
bus_space_tag_t iot; bus_space_tag_t memt, bus_space_handle_t memh, int irq, int maddr,
bus_space_handle_t ioh; u_int8_t type)
bus_space_tag_t memt;
bus_space_handle_t memh;
int irq;
int maddr;
u_int8_t type;
{ {
u_int16_t cr; u_int16_t cr;
u_int8_t ident; u_int8_t ident;
@ -413,8 +397,7 @@ snc_nec16_detectsubr(iot, ioh, memt, memh, irq, maddr, type)
#define SNC_NEC_SERIES_PNP_CBUS2 0x3d #define SNC_NEC_SERIES_PNP_CBUS2 0x3d
u_int8_t * u_int8_t *
snc_nec16_detect_type(myea) snc_nec16_detect_type(u_int8_t *myea)
u_int8_t *myea;
{ {
u_int32_t vendor = (myea[0] << 16) | (myea[1] << 8) | myea[2]; u_int32_t vendor = (myea[0] << 16) | (myea[1] << 8) | myea[2];
u_int8_t series = myea[3]; u_int8_t series = myea[3];
@ -459,10 +442,8 @@ snc_nec16_detect_type(myea)
} }
int int
snc_nec16_get_enaddr(iot, ioh, myea) snc_nec16_get_enaddr(bus_space_tag_t iot, bus_space_handle_t ioh,
bus_space_tag_t iot; u_int8_t *myea)
bus_space_handle_t ioh;
u_int8_t *myea;
{ {
u_int8_t eeprom[SNEC_EEPROM_SIZE]; u_int8_t eeprom[SNEC_EEPROM_SIZE];
u_int8_t rom_sum, sum = 0x00; u_int8_t rom_sum, sum = 0x00;
@ -493,9 +474,7 @@ snc_nec16_get_enaddr(iot, ioh, myea)
* read from NEC/SONIC NIC register. * read from NEC/SONIC NIC register.
*/ */
u_int16_t u_int16_t
snc_nec16_nic_get(sc, reg) snc_nec16_nic_get(struct snc_softc *sc, u_int8_t reg)
struct snc_softc *sc;
u_int8_t reg;
{ {
u_int16_t val; u_int16_t val;
@ -510,10 +489,7 @@ snc_nec16_nic_get(sc, reg)
* write to NEC/SONIC NIC register. * write to NEC/SONIC NIC register.
*/ */
void void
snc_nec16_nic_put(sc, reg, val) snc_nec16_nic_put(struct snc_softc *sc, u_int8_t reg, u_int16_t val)
struct snc_softc *sc;
u_int8_t reg;
u_int16_t val;
{ {
/* select SONIC register */ /* select SONIC register */
@ -527,10 +503,7 @@ snc_nec16_nic_put(sc, reg, val)
* where exists specified (internal buffer memory) offset. * where exists specified (internal buffer memory) offset.
*/ */
static __inline u_int16_t static __inline u_int16_t
snc_nec16_select_bank(sc, base, offset) snc_nec16_select_bank(struct snc_softc *sc, u_int32_t base, u_int32_t offset)
struct snc_softc *sc;
u_int32_t base;
u_int32_t offset;
{ {
bus_space_tag_t iot = sc->sc_iot; bus_space_tag_t iot = sc->sc_iot;
bus_space_handle_t ioh = sc->sc_ioh; bus_space_handle_t ioh = sc->sc_ioh;
@ -565,11 +538,8 @@ snc_nec16_select_bank(sc, base, offset)
* write to SONIC descriptors. * write to SONIC descriptors.
*/ */
void void
snc_nec16_writetodesc(sc, base, offset, val) snc_nec16_writetodesc(struct snc_softc *sc, u_int32_t base, u_int32_t offset,
struct snc_softc *sc; u_int16_t val)
u_int32_t base;
u_int32_t offset;
u_int16_t val;
{ {
bus_space_tag_t memt = sc->sc_memt; bus_space_tag_t memt = sc->sc_memt;
bus_space_handle_t memh = sc->sc_memh; bus_space_handle_t memh = sc->sc_memh;
@ -584,10 +554,7 @@ snc_nec16_writetodesc(sc, base, offset, val)
* read from SONIC descriptors. * read from SONIC descriptors.
*/ */
u_int16_t u_int16_t
snc_nec16_readfromdesc(sc, base, offset) snc_nec16_readfromdesc(struct snc_softc *sc, u_int32_t base, u_int32_t offset)
struct snc_softc *sc;
u_int32_t base;
u_int32_t offset;
{ {
bus_space_tag_t memt = sc->sc_memt; bus_space_tag_t memt = sc->sc_memt;
bus_space_handle_t memh = sc->sc_memh; bus_space_handle_t memh = sc->sc_memh;
@ -602,11 +569,8 @@ snc_nec16_readfromdesc(sc, base, offset)
* read from SONIC data buffer. * read from SONIC data buffer.
*/ */
void void
snc_nec16_copyfrombuf(sc, dst, offset, size) snc_nec16_copyfrombuf(struct snc_softc *sc, void *dst, u_int32_t offset,
struct snc_softc *sc; size_t size)
void *dst;
u_int32_t offset;
size_t size;
{ {
bus_space_tag_t memt = sc->sc_memt; bus_space_tag_t memt = sc->sc_memt;
bus_space_handle_t memh = sc->sc_memh; bus_space_handle_t memh = sc->sc_memh;
@ -644,11 +608,8 @@ snc_nec16_copyfrombuf(sc, dst, offset, size)
* write to SONIC data buffer. * write to SONIC data buffer.
*/ */
void void
snc_nec16_copytobuf(sc, src, offset, size) snc_nec16_copytobuf(struct snc_softc *sc, void *src, u_int32_t offset,
struct snc_softc *sc; size_t size)
void *src;
u_int32_t offset;
size_t size;
{ {
bus_space_tag_t memt = sc->sc_memt; bus_space_tag_t memt = sc->sc_memt;
bus_space_handle_t memh = sc->sc_memh; bus_space_handle_t memh = sc->sc_memh;
@ -688,10 +649,7 @@ snc_nec16_copytobuf(sc, src, offset, size)
* write (fill) 0 to SONIC data buffer. * write (fill) 0 to SONIC data buffer.
*/ */
void void
snc_nec16_zerobuf(sc, offset, size) snc_nec16_zerobuf(struct snc_softc *sc, u_int32_t offset, size_t size)
struct snc_softc *sc;
u_int32_t offset;
size_t size;
{ {
bus_space_tag_t memt = sc->sc_memt; bus_space_tag_t memt = sc->sc_memt;
bus_space_handle_t memh = sc->sc_memh; bus_space_handle_t memh = sc->sc_memh;
@ -735,10 +693,8 @@ snc_nec16_zerobuf(sc, offset, size)
#define SNEC_EEP_DELAY 1000 #define SNEC_EEP_DELAY 1000
void void
snc_nec16_read_eeprom(iot, ioh, data) snc_nec16_read_eeprom(bus_space_tag_t iot, bus_space_handle_t ioh,
bus_space_tag_t iot; u_int8_t *data)
bus_space_handle_t ioh;
u_int8_t *data;
{ {
u_int8_t n, val, bit; u_int8_t n, val, bit;
@ -851,9 +807,7 @@ snc_nec16_read_eeprom(iot, ioh, data)
#ifdef SNCDEBUG #ifdef SNCDEBUG
void void
snc_nec16_dump_reg(iot, ioh) snc_nec16_dump_reg(bus_space_tag_t iot, bus_space_handle_t ioh)
bus_space_tag_t iot;
bus_space_handle_t ioh;
{ {
u_int8_t n; u_int8_t n;
u_int16_t val; u_int16_t val;

View File

@ -66,9 +66,7 @@ devclass_t snc_devclass;
* Allocate a port resource with the given resource id. * Allocate a port resource with the given resource id.
*/ */
int int
snc_alloc_port(dev, rid) snc_alloc_port(device_t dev, int rid)
device_t dev;
int rid;
{ {
struct snc_softc *sc = device_get_softc(dev); struct snc_softc *sc = device_get_softc(dev);
struct resource *res; struct resource *res;
@ -91,9 +89,7 @@ snc_alloc_port(dev, rid)
* Allocate a memory resource with the given resource id. * Allocate a memory resource with the given resource id.
*/ */
int int
snc_alloc_memory(dev, rid) snc_alloc_memory(device_t dev, int rid)
device_t dev;
int rid;
{ {
struct snc_softc *sc = device_get_softc(dev); struct snc_softc *sc = device_get_softc(dev);
struct resource *res; struct resource *res;
@ -116,10 +112,7 @@ snc_alloc_memory(dev, rid)
* Allocate an irq resource with the given resource id. * Allocate an irq resource with the given resource id.
*/ */
int int
snc_alloc_irq(dev, rid, flags) snc_alloc_irq(device_t dev, int rid, int flags)
device_t dev;
int rid;
int flags;
{ {
struct snc_softc *sc = device_get_softc(dev); struct snc_softc *sc = device_get_softc(dev);
struct resource *res; struct resource *res;
@ -139,8 +132,7 @@ snc_alloc_irq(dev, rid, flags)
* Release all resources * Release all resources
*/ */
void void
snc_release_resources(dev) snc_release_resources(device_t dev)
device_t dev;
{ {
struct snc_softc *sc = device_get_softc(dev); struct snc_softc *sc = device_get_softc(dev);
@ -170,9 +162,7 @@ snc_release_resources(dev)
****************************************************************/ ****************************************************************/
int int
snc_probe(dev, type) snc_probe(device_t dev, int type)
device_t dev;
int type;
{ {
struct snc_softc *sc = device_get_softc(dev); struct snc_softc *sc = device_get_softc(dev);
@ -188,8 +178,7 @@ snc_probe(dev, type)
****************************************************************/ ****************************************************************/
int int
snc_attach(dev) snc_attach(device_t dev)
device_t dev;
{ {
struct snc_softc *sc = device_get_softc(dev); struct snc_softc *sc = device_get_softc(dev);
u_int8_t myea[ETHER_ADDR_LEN]; u_int8_t myea[ETHER_ADDR_LEN];
@ -253,8 +242,7 @@ snc_attach(dev)
****************************************************************/ ****************************************************************/
int int
snc_shutdown(dev) snc_shutdown(device_t dev)
device_t dev;
{ {
struct snc_softc *sc = device_get_softc(dev); struct snc_softc *sc = device_get_softc(dev);

View File

@ -68,8 +68,7 @@ static struct isa_pnp_id snc_ids[] = {
}; };
static void static void
snc_isapnp_reconfig(dev) snc_isapnp_reconfig(device_t dev)
device_t dev;
{ {
struct isa_device *idev = DEVTOISA(dev); struct isa_device *idev = DEVTOISA(dev);
struct isa_config config; struct isa_config config;
@ -111,8 +110,7 @@ snc_isapnp_reconfig(dev)
} }
static int static int
snc_isa_probe(dev) snc_isa_probe(device_t dev)
device_t dev;
{ {
struct snc_softc *sc = device_get_softc(dev); struct snc_softc *sc = device_get_softc(dev);
int type; int type;
@ -177,8 +175,7 @@ snc_isa_probe(dev)
} }
static int static int
snc_isa_attach(dev) snc_isa_attach(device_t dev)
device_t dev;
{ {
struct snc_softc *sc = device_get_softc(dev); struct snc_softc *sc = device_get_softc(dev);