diff options
author | Marco Peereboom <marco@cvs.openbsd.org> | 2004-06-22 18:57:19 +0000 |
---|---|---|
committer | Marco Peereboom <marco@cvs.openbsd.org> | 2004-06-22 18:57:19 +0000 |
commit | 48f6486fb46237947f1480b6a977769b31fa4723 (patch) | |
tree | e98d9772889728d881e4a2a64e933a9d2953817d /sys/dev/ic | |
parent | 623971e86ddabd054b70257e45de3a649587efb1 (diff) |
Remove all static functions. ok krw@
Diffstat (limited to 'sys/dev/ic')
-rw-r--r-- | sys/dev/ic/mpt.c | 43 | ||||
-rw-r--r-- | sys/dev/ic/mpt_debug.c | 50 | ||||
-rw-r--r-- | sys/dev/ic/mpt_openbsd.c | 44 |
3 files changed, 83 insertions, 54 deletions
diff --git a/sys/dev/ic/mpt.c b/sys/dev/ic/mpt.c index 4cbf504dd7b..0bc7f3a2595 100644 --- a/sys/dev/ic/mpt.c +++ b/sys/dev/ic/mpt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpt.c,v 1.6 2004/04/28 01:45:48 marco Exp $ */ +/* $OpenBSD: mpt.c,v 1.7 2004/06/22 18:57:18 marco Exp $ */ /* $NetBSD: mpt.c,v 1.4 2003/11/02 11:07:45 wiz Exp $ */ /* @@ -50,20 +50,33 @@ static int maxwait_ack = 0; static int maxwait_int = 0; static int maxwait_state = 0; -static __inline u_int32_t +__inline u_int32_t mpt_rd_db(mpt_softc_t *); +__inline u_int32_t mpt_rd_intr(mpt_softc_t *); +int mpt_wait_db_ack(mpt_softc_t *); +int mpt_wait_db_int(mpt_softc_t *); +int mpt_wait_state(mpt_softc_t *, enum DB_STATE_BITS); +int mpt_get_iocfacts(mpt_softc_t *, MSG_IOC_FACTS_REPLY *); +int mpt_get_portfacts(mpt_softc_t *, MSG_PORT_FACTS_REPLY *); +int mpt_send_ioc_init(mpt_softc_t *, u_int32_t); +int mpt_read_config_info_spi(mpt_softc_t *); +int mpt_set_initial_config_spi(mpt_softc_t *); +int mpt_send_port_enable(mpt_softc_t *, int); +int mpt_send_event_request(mpt_softc_t *, int); + +__inline u_int32_t mpt_rd_db(mpt_softc_t *mpt) { return mpt_read(mpt, MPT_OFFSET_DOORBELL); } -static __inline u_int32_t +__inline u_int32_t mpt_rd_intr(mpt_softc_t *mpt) { return mpt_read(mpt, MPT_OFFSET_INTR_STATUS); } /* Busy wait for a door bell to be read by IOC */ -static int +int mpt_wait_db_ack(mpt_softc_t *mpt) { int i; @@ -79,7 +92,7 @@ mpt_wait_db_ack(mpt_softc_t *mpt) } /* Busy wait for a door bell interrupt */ -static int +int mpt_wait_db_int(mpt_softc_t *mpt) { int i; @@ -118,7 +131,7 @@ mpt_check_doorbell(mpt_softc_t *mpt) } /* Wait for IOC to transition to a give state */ -static int +int mpt_wait_state(mpt_softc_t *mpt, enum DB_STATE_BITS state) { int i; @@ -496,7 +509,7 @@ mpt_recv_handshake_reply(mpt_softc_t *mpt, size_t reply_len, void *reply) return (0); } -static int +int mpt_get_iocfacts(mpt_softc_t *mpt, MSG_IOC_FACTS_REPLY *freplp) { MSG_IOC_FACTS f_req; @@ -512,7 +525,7 @@ mpt_get_iocfacts(mpt_softc_t *mpt, MSG_IOC_FACTS_REPLY *freplp) return (error); } -static int +int mpt_get_portfacts(mpt_softc_t *mpt, MSG_PORT_FACTS_REPLY *freplp) { MSG_PORT_FACTS f_req; @@ -535,7 +548,7 @@ mpt_get_portfacts(mpt_softc_t *mpt, MSG_PORT_FACTS_REPLY *freplp) * This is also the command that specifies the max size of the reply * frames from the IOC that we will be allocating. */ -static int +int mpt_send_ioc_init(mpt_softc_t *mpt, u_int32_t who) { int error = 0; @@ -587,10 +600,10 @@ mpt_send_ioc_init(mpt_softc_t *mpt, u_int32_t who) * Utiltity routine to read configuration headers and pages */ -static int +int mpt_read_cfg_header(mpt_softc_t *, int, int, int, fCONFIG_PAGE_HEADER *); -static int +int mpt_read_cfg_header(mpt_softc_t *mpt, int PageType, int PageNumber, int PageAddress, fCONFIG_PAGE_HEADER *rslt) { @@ -803,7 +816,7 @@ mpt_write_cfg_page(mpt_softc_t *mpt, int PageAddress, fCONFIG_PAGE_HEADER *hdr) /* * Read SCSI configuration information */ -static int +int mpt_read_config_info_spi(mpt_softc_t *mpt) { int rv, i; @@ -953,7 +966,7 @@ mpt_read_config_info_spi(mpt_softc_t *mpt) * * In particular, validate SPI Port Page 1. */ -static int +int mpt_set_initial_config_spi(mpt_softc_t *mpt) { int i, pp1val = ((1 << mpt->mpt_ini_id) << 16) | mpt->mpt_ini_id; @@ -1012,7 +1025,7 @@ mpt_set_initial_config_spi(mpt_softc_t *mpt) /* * Enable IOC port */ -static int +int mpt_send_port_enable(mpt_softc_t *mpt, int port) { int count; @@ -1053,7 +1066,7 @@ mpt_send_port_enable(mpt_softc_t *mpt, int port) * NB: this is the first command we send via shared memory * instead of the handshake register. */ -static int +int mpt_send_event_request(mpt_softc_t *mpt, int onoff) { request_t *req; diff --git a/sys/dev/ic/mpt_debug.c b/sys/dev/ic/mpt_debug.c index 644c82f2924..bea147ee9ac 100644 --- a/sys/dev/ic/mpt_debug.c +++ b/sys/dev/ic/mpt_debug.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpt_debug.c,v 1.1 2004/03/06 03:03:07 krw Exp $ */ +/* $OpenBSD: mpt_debug.c,v 1.2 2004/06/22 18:57:18 marco Exp $ */ /* $NetBSD: mpt_debug.c,v 1.2 2003/07/14 15:47:11 lukem Exp $ */ /* @@ -40,6 +40,21 @@ #include <dev/ic/mpt.h> +char *mpt_ioc_status(int); +char *mpt_ioc_function(int); +char *mpt_ioc_event(int); +char *mpt_scsi_state(int); +char *mpt_scsi_status(int); +char *mpt_who(int); +char *mpt_state(u_int32_t); +void mpt_print_reply_hdr(MSG_DEFAULT_REPLY *); +void mpt_print_init_reply(MSG_IOC_INIT_REPLY *); +void mpt_print_ioc_facts(MSG_IOC_FACTS_REPLY *); +void mpt_print_enable_reply(MSG_PORT_ENABLE_REPLY *); +void mpt_print_scsi_io_reply(MSG_SCSI_IO_REPLY *); +void mpt_print_event_notice(MSG_EVENT_NOTIFY_REPLY *); +void mpt_print_request_hdr(MSG_REQUEST_HEADER *); + struct Error_Map { int Error_Code; char *Error_String; @@ -175,9 +190,9 @@ static const struct Error_Map IOC_Diag[] = { }; -static void mpt_dump_sgl(SGE_IO_UNION *sgl); +void mpt_dump_sgl(SGE_IO_UNION *sgl); -static char * +char * mpt_ioc_status(int code) { const struct Error_Map *status = IOC_Status; @@ -209,7 +224,7 @@ mpt_ioc_diag(u_int32_t code) return buf; } -static char * +char * mpt_ioc_function(int code) { const struct Error_Map *status = IOC_Func; @@ -222,7 +237,7 @@ mpt_ioc_function(int code) snprintf(buf, sizeof buf, "Unknown (0x%08x)", code); return buf; } -static char * +char * mpt_ioc_event(int code) { const struct Error_Map *status = IOC_Event; @@ -235,7 +250,7 @@ mpt_ioc_event(int code) snprintf(buf, sizeof buf, "Unknown (0x%08x)", code); return buf; } -static char * +char * mpt_scsi_state(int code) { const struct Error_Map *status = IOC_SCSIState; @@ -252,7 +267,7 @@ mpt_scsi_state(int code) } return buf; } -static char * +char * mpt_scsi_status(int code) { const struct Error_Map *status = IOC_SCSIStatus; @@ -265,7 +280,8 @@ mpt_scsi_status(int code) snprintf(buf, sizeof buf, "Unknown (0x%08x)", code); return buf; } -static char * + +char * mpt_who(int who_init) { char *who; @@ -282,7 +298,7 @@ mpt_who(int who_init) return who; } -static char * +char * mpt_state(u_int32_t mb) { char *text; @@ -307,7 +323,7 @@ mpt_print_db(u_int32_t mb) /*****************************************************************************/ /* Reply functions */ /*****************************************************************************/ -static void +void mpt_print_reply_hdr(MSG_DEFAULT_REPLY *msg) { printf("%s Reply @ %p\n", mpt_ioc_function(msg->Function), msg); @@ -318,7 +334,7 @@ mpt_print_reply_hdr(MSG_DEFAULT_REPLY *msg) printf("\tMsgContext 0x%08x\n", msg->MsgContext); } -static void +void mpt_print_init_reply(MSG_IOC_INIT_REPLY *msg) { mpt_print_reply_hdr((MSG_DEFAULT_REPLY *)msg); @@ -327,7 +343,7 @@ mpt_print_init_reply(MSG_IOC_INIT_REPLY *msg) printf("\tMaxBuses 0x%02x\n", msg->MaxBuses); } -static void +void mpt_print_ioc_facts(MSG_IOC_FACTS_REPLY *msg) { mpt_print_reply_hdr((MSG_DEFAULT_REPLY *)msg); @@ -352,14 +368,14 @@ mpt_print_ioc_facts(MSG_IOC_FACTS_REPLY *msg) printf("\tFWImageSize 0x%04x\n", msg->FWImageSize); } -static void +void mpt_print_enable_reply(MSG_PORT_ENABLE_REPLY *msg) { mpt_print_reply_hdr((MSG_DEFAULT_REPLY *)msg); printf("\tPort: %d\n", msg->PortNumber); } -static void +void mpt_print_scsi_io_reply(MSG_SCSI_IO_REPLY *msg) { mpt_print_reply_hdr((MSG_DEFAULT_REPLY *)msg); @@ -375,7 +391,7 @@ mpt_print_scsi_io_reply(MSG_SCSI_IO_REPLY *msg) -static void +void mpt_print_event_notice(MSG_EVENT_NOTIFY_REPLY *msg) { mpt_print_reply_hdr((MSG_DEFAULT_REPLY *)msg); @@ -460,7 +476,7 @@ mpt_print_reply(void *vmsg) /*****************************************************************************/ /* Request functions */ /*****************************************************************************/ -static void +void mpt_print_request_hdr(MSG_REQUEST_HEADER *req) { printf("%s @ %p\n", mpt_ioc_function(req->Function), req); @@ -549,7 +565,7 @@ mpt_req_state(enum mpt_req_state state) return text; }; -static void +void mpt_dump_sgl(SGE_IO_UNION *su) { SGE_SIMPLE32 *se = (SGE_SIMPLE32 *) su; diff --git a/sys/dev/ic/mpt_openbsd.c b/sys/dev/ic/mpt_openbsd.c index 865e92c92d6..1105a2fe125 100644 --- a/sys/dev/ic/mpt_openbsd.c +++ b/sys/dev/ic/mpt_openbsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpt_openbsd.c,v 1.11 2004/04/28 01:45:48 marco Exp $ */ +/* $OpenBSD: mpt_openbsd.c,v 1.12 2004/06/22 18:57:18 marco Exp $ */ /* $NetBSD: mpt_netbsd.c,v 1.7 2003/07/14 15:47:11 lukem Exp $ */ /* @@ -101,18 +101,18 @@ #include <dev/ic/mpt.h> /* pulls in all headers */ -static void mpt_run_ppr(mpt_softc_t *); -static int mpt_ppr(mpt_softc_t *, struct scsi_link *, int speed); -static int mpt_poll(mpt_softc_t *, struct scsi_xfer *, int); -static void mpt_timeout(void *); -static void mpt_done(mpt_softc_t *, uint32_t); -static int mpt_run_xfer(mpt_softc_t *, struct scsi_xfer *); -static void mpt_check_xfer_settings(mpt_softc_t *, struct scsi_xfer *, MSG_SCSI_IO_REQUEST *); -static void mpt_ctlop(mpt_softc_t *, void *vmsg, uint32_t); -static void mpt_event_notify_reply(mpt_softc_t *, MSG_EVENT_NOTIFY_REPLY *); +void mpt_run_ppr(mpt_softc_t *); +int mpt_ppr(mpt_softc_t *, struct scsi_link *, int speed); +int mpt_poll(mpt_softc_t *, struct scsi_xfer *, int); +void mpt_timeout(void *); +void mpt_done(mpt_softc_t *, uint32_t); +int mpt_run_xfer(mpt_softc_t *, struct scsi_xfer *); +void mpt_check_xfer_settings(mpt_softc_t *, struct scsi_xfer *, MSG_SCSI_IO_REQUEST *); +void mpt_ctlop(mpt_softc_t *, void *vmsg, uint32_t); +void mpt_event_notify_reply(mpt_softc_t *, MSG_EVENT_NOTIFY_REPLY *); -static int mpt_action(struct scsi_xfer *); -static void mpt_minphys(struct buf *); +int mpt_action(struct scsi_xfer *); +void mpt_minphys(struct buf *); struct cfdriver mpt_cd = { NULL, "mpt", DV_DULL @@ -658,7 +658,7 @@ mpt_prt(mpt_softc_t *mpt, const char *fmt, ...) printf("\n"); } -static int +int mpt_poll(mpt_softc_t *mpt, struct scsi_xfer *xs, int count) { @@ -674,7 +674,7 @@ mpt_poll(mpt_softc_t *mpt, struct scsi_xfer *xs, int count) return (1); } -static void +void mpt_timeout(void *arg) { request_t *req = arg; @@ -721,7 +721,7 @@ mpt_timeout(void *arg) splx(s); } -static void +void mpt_done(mpt_softc_t *mpt, uint32_t reply) { struct scsi_xfer *xs = NULL; @@ -991,7 +991,7 @@ mpt_done(mpt_softc_t *mpt, uint32_t reply) } } -static int +int mpt_run_xfer(mpt_softc_t *mpt, struct scsi_xfer *xs) { struct scsi_link *linkp = xs->sc_link; @@ -1252,7 +1252,7 @@ mpt_run_xfer(mpt_softc_t *mpt, struct scsi_xfer *xs) return (COMPLETE); } -static void +void mpt_ctlop(mpt_softc_t *mpt, void *vmsg, uint32_t reply) { MSG_DEFAULT_REPLY *dmsg = vmsg; @@ -1299,7 +1299,7 @@ mpt_ctlop(mpt_softc_t *mpt, void *vmsg, uint32_t reply) } } -static void +void mpt_event_notify_reply(mpt_softc_t *mpt, MSG_EVENT_NOTIFY_REPLY *msg) { @@ -1502,7 +1502,7 @@ mpt_check_xfer_settings(mpt_softc_t *mpt, struct scsi_xfer *xs, MSG_SCSI_IO_REQU * SCSI interface routines *****************************************************************************/ -static int +int mpt_action(struct scsi_xfer *xfer) { mpt_softc_t *mpt = (void *) xfer->sc_link->adapter_softc; @@ -1527,7 +1527,7 @@ mpt_action(struct scsi_xfer *xfer) #endif } -static void +void mpt_minphys(struct buf *bp) { @@ -1556,7 +1556,7 @@ mpt_alloc_fw_mem(mpt_softc_t *mpt, uint32_t img_sz, int maxsgl) error = bus_dmamem_alloc(mpt->sc_dmat, img_sz, PAGE_SIZE, 0, &mpt->fw_seg, maxsgl, &mpt->fw_rseg, 0); if (error) { - mpt_prt(mpt, "unable to allocate fw memory, error = %d", error); + mpt_prt(mpt, "unable to allocate fw memory, error = %d", error); goto fw_fail0; } @@ -1578,7 +1578,7 @@ mpt_alloc_fw_mem(mpt_softc_t *mpt, uint32_t img_sz, int maxsgl) error = bus_dmamap_load(mpt->sc_dmat, mpt->fw_dmap, mpt->fw, img_sz, NULL, 0); if (error) { - mpt_prt(mpt, "unable to load request DMA map, error = %d", error); + mpt_prt(mpt, "unable to load request DMA map, error = %d", error); goto fw_fail3; } |