Unify prototypes.

Cosmetics.
This commit is contained in:
sos 2003-08-25 09:01:49 +00:00
parent 15c0484287
commit 1c87c82d4e
11 changed files with 91 additions and 85 deletions

View File

@ -65,13 +65,13 @@ static struct cdevsw ata_cdevsw = {
};
/* prototypes */
static void ata_shutdown(void *arg, int howto);
static int ata_getparam(struct ata_device *atadev, u_int8_t command);
static void ata_identify_devices(struct ata_channel *ch);
static void ata_shutdown(void *, int);
static int ata_getparam(struct ata_device *, u_int8_t);
static void ata_identify_devices(struct ata_channel *);
static void ata_boot_attach(void);
static void bswap(int8_t *buf, int len);
static void btrim(int8_t *buf, int len);
static void bpack(int8_t *src, int8_t *dst, int len);
static void bswap(int8_t *, int);
static void btrim(int8_t *, int);
static void bpack(int8_t *, int8_t *, int);
static void ata_init(void);
/* sysctl vars */

View File

@ -196,7 +196,7 @@ struct ata_request {
#define ATA_R_REQUEUE 0x0400
#define ATA_R_SKIPSTART 0x0800
void (*callback)(struct ata_request *);
void (*callback)(struct ata_request *request);
int retries; /* retry count */
int timeout; /* timeout for this cmd */
struct callout_handle timeout_handle; /* handle for untimeout */
@ -216,9 +216,9 @@ struct ata_device {
char *name; /* device name */
struct ata_params *param; /* ata param structure */
void *softc; /* ptr to softc for device */
void (*attach)(struct ata_device *);
void (*detach)(struct ata_device *);
void (*start)(struct ata_device *);
void (*attach)(struct ata_device *atadev);
void (*detach)(struct ata_device *atadev);
void (*start)(struct ata_device *atadev);
int flags;
#define ATA_D_USE_CHS 0x0001
#define ATA_D_DETACHING 0x0002
@ -227,7 +227,7 @@ struct ata_device {
int cmd; /* last cmd executed */
int mode; /* transfermode */
void (*setmode)(struct ata_device *, int);
void (*setmode)(struct ata_device *atadev, int mode);
};
/* structure for holding DMA address data */
@ -251,18 +251,18 @@ struct ata_dma {
#define ATA_DMA_ACTIVE 0x01 /* DMA transfer in progress */
#define ATA_DMA_READ 0x02 /* transaction is a read */
int (*alloc)(struct ata_channel *);
void (*free)(struct ata_channel *);
int (*setup)(struct ata_device *, caddr_t, int32_t);
int (*start)(struct ata_channel *, caddr_t, int32_t, int);
int (*stop)(struct ata_channel *);
int (*alloc)(struct ata_channel *ch);
void (*free)(struct ata_channel *ch);
int (*setup)(struct ata_device *atadev, caddr_t data, int32_t count);
int (*start)(struct ata_channel *ch, caddr_t data, int32_t count, int dir);
int (*stop)(struct ata_channel *ch);
};
/* structure holding lowlevel functions */
struct ata_lowlevel {
void (*reset)(struct ata_channel *);
int (*transaction)(struct ata_request *);
void (*interrupt)(void *);
void (*reset)(struct ata_channel *ch);
int (*transaction)(struct ata_request *request);
void (*interrupt)(void *channel);
};
/* structure holding resources for an ATA channel */
@ -347,19 +347,19 @@ extern int ata_dma, ata_wc, atapi_dma;
/* public prototypes */
/* ata-all.c: */
int ata_probe(device_t);
int ata_attach(device_t);
int ata_detach(device_t);
int ata_suspend(device_t);
int ata_resume(device_t);
int ata_printf(struct ata_channel *, int, const char *, ...) __printflike(3, 4);
int ata_prtdev(struct ata_device *, const char *, ...) __printflike(2, 3);
void ata_set_name(struct ata_device *, char *, int);
void ata_free_name(struct ata_device *);
int ata_get_lun(u_int32_t *);
int ata_test_lun(u_int32_t *, int);
void ata_free_lun(u_int32_t *, int);
char *ata_mode2str(int);
int ata_probe(device_t dev);
int ata_attach(device_t dev);
int ata_detach(device_t dev);
int ata_suspend(device_t dev);
int ata_resume(device_t dev);
int ata_printf(struct ata_channel *ch, int device, const char *fmt, ...) __printflike(3, 4);
int ata_prtdev(struct ata_device *atadev, const char *fmt, ...) __printflike(2, 3);
void ata_set_name(struct ata_device *atadev, char *name, int lun);
void ata_free_name(struct ata_device *atadev);
int ata_get_lun(u_int32_t *map);
int ata_test_lun(u_int32_t *map, int lun);
void ata_free_lun(u_int32_t *map, int lun);
char *ata_mode2str(int mode);
int ata_pmode(struct ata_params *ap);
int ata_wmode(struct ata_params *ap);
int ata_umode(struct ata_params *ap);
@ -380,13 +380,13 @@ char *ata_cmd2str(struct ata_request *request);
void ata_generic_hw(struct ata_channel *ch);
/* subdrivers */
void ad_attach(struct ata_device *);
void acd_attach(struct ata_device *);
void afd_attach(struct ata_device *);
void ast_attach(struct ata_device *);
void atapi_cam_attach_bus(struct ata_channel *);
void atapi_cam_detach_bus(struct ata_channel *);
void atapi_cam_reinit_bus(struct ata_channel *);
void ad_attach(struct ata_device *atadev);
void acd_attach(struct ata_device *atadev);
void afd_attach(struct ata_device *atadev);
void ast_attach(struct ata_device *atadev);
void atapi_cam_attach_bus(struct ata_channel *ch);
void atapi_cam_detach_bus(struct ata_channel *ch);
void atapi_cam_reinit_bus(struct ata_channel *ch);
/* macros for locking a channel */
#define ATA_LOCK_CH(ch, value) \

View File

@ -74,7 +74,7 @@ ata_pccard_match(device_t dev)
/* match other devices here, primarily cdrom/dvd rom */
if ((pp = pccard_product_lookup(dev, ata_pccard_products,
sizeof(ata_pccard_products[0]), NULL)) != NULL) {
sizeof(ata_pccard_products[0]), NULL))) {
if (pp->pp_name)
device_set_desc(dev, pp->pp_name);
return (0);

View File

@ -73,14 +73,14 @@ ata_cbus_probe(device_t dev)
/* dont probe PnP devices */
if (isa_get_vendorid(dev))
return (ENXIO);
return (ENXIO);
/* allocate the ioport range */
rid = ATA_IOADDR_RID;
io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0,
ATA_PC98_IOSIZE, RF_ACTIVE);
if (!io)
return ENOMEM;
return ENOMEM;
/* calculate & set the altport range */
rid = ATA_PC98_ALTADDR_RID;
@ -125,8 +125,8 @@ ata_cbus_attach(device_t dev)
rid = ATA_PC98_BANKADDR_RID;
ctlr->bankio = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid,
ATA_PC98_BANK, ~0,
ATA_PC98_BANKIOSIZE, RF_ACTIVE);
ATA_PC98_BANK, ~0,
ATA_PC98_BANKIOSIZE, RF_ACTIVE);
if (!ctlr->bankio) {
bus_release_resource(dev, SYS_RES_IOPORT, ATA_IOADDR_RID, ctlr->io);
bus_release_resource(dev, SYS_RES_IOPORT, ATA_ALTADDR_RID, ctlr->altio);
@ -181,9 +181,8 @@ ata_cbus_alloc_resource(device_t dev, device_t child, int type, int *rid,
return ctlr->altio;
}
}
if (type == SYS_RES_IRQ) {
if (type == SYS_RES_IRQ)
return ctlr->irq;
}
return 0;
}

View File

@ -54,14 +54,14 @@ __FBSDID("$FreeBSD$");
#include <dev/ata/ata-raid.h>
/* prototypes */
static void ad_detach(struct ata_device *atadev);
static void ad_start(struct ata_device *atadev);
static void ad_done(struct ata_request *request);
static void ad_detach(struct ata_device *);
static void ad_start(struct ata_device *);
static void ad_done(struct ata_request *);
static disk_open_t adopen;
static disk_strategy_t adstrategy;
static dumper_t addump;
void ad_print(struct ad_softc *adp);
static int ad_version(u_int16_t version);
void ad_print(struct ad_softc *);
static int ad_version(u_int16_t);
/* internal vars */
static MALLOC_DEFINE(M_AD, "AD driver", "ATA disk driver");

View File

@ -30,7 +30,6 @@
__FBSDID("$FreeBSD$");
#include "opt_ata.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/ata.h>

View File

@ -43,13 +43,13 @@ __FBSDID("$FreeBSD$");
#include <dev/ata/ata-all.h>
/* prototypes */
static int ata_transaction(struct ata_request *request);
static void ata_interrupt(void *data);
static void ata_reset(struct ata_channel *ch);
static int ata_wait(struct ata_device *atadev, u_int8_t mask);
static int ata_command(struct ata_device *atadev, u_int8_t command, u_int64_t lba, u_int16_t count, u_int16_t feature);
static void ata_pio_read(struct ata_request *request, int length);
static void ata_pio_write(struct ata_request *request, int length);
static int ata_transaction(struct ata_request *);
static void ata_interrupt(void *);
static void ata_reset(struct ata_channel *);
static int ata_wait(struct ata_device *, u_int8_t);
static int ata_command(struct ata_device *, u_int8_t, u_int64_t, u_int16_t, u_int16_t);
static void ata_pio_read(struct ata_request *, int);
static void ata_pio_write(struct ata_request *, int);
/* local vars */
static int atadebug = 0;

View File

@ -45,9 +45,9 @@ __FBSDID("$FreeBSD$");
#include <dev/ata/ata-all.h>
/* prototypes */
static void ata_completed(void *context, int pending);
static void ata_timeout(struct ata_request *request);
static char *ata_sensekey2str(u_int8_t skey);
static void ata_completed(void *, int);
static void ata_timeout(struct ata_request *);
static char *ata_sensekey2str(u_int8_t);
/* local vars */
static MALLOC_DEFINE(M_ATA_REQ, "ATA request", "ATA request");

View File

@ -69,8 +69,8 @@ static struct cdevsw acd_cdevsw = {
};
/* prototypes */
static void acd_detach(struct ata_device *atadev);
static void acd_start(struct ata_device *atadev);
static void acd_detach(struct ata_device *);
static void acd_start(struct ata_device *);
static struct acd_softc *acd_init_lun(struct ata_device *);
static void acd_make_dev(struct acd_softc *);
@ -104,8 +104,8 @@ static int acd_set_speed(struct acd_softc *, int, int);
static void acd_get_cap(struct acd_softc *);
static int acd_read_format_caps(struct acd_softc *, struct cdr_format_capacities *);
static int acd_format(struct acd_softc *, struct cdr_format_params *);
static int acd_test_ready(struct ata_device *atadev);
static int acd_request_sense(struct ata_device *atadev, struct atapi_sense *sense);
static int acd_test_ready(struct ata_device *);
static int acd_request_sense(struct ata_device *, struct atapi_sense *);
/* internal vars */
static u_int32_t acd_lun_map = 0;
@ -710,8 +710,9 @@ acd_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct thread *td)
te->data, len);
if (te->address_format == CD_MSF_FORMAT)
free(toc, M_ACD);
break;
}
break;
case CDIOREADTOCENTRY:
{
struct ioc_read_toc_single_entry *te =
@ -802,8 +803,8 @@ acd_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct thread *td)
}
}
error = copyout(&cdp->subchan, args->data, args->data_len);
break;
}
break;
case CDIOCPLAYMSF:
{
@ -813,16 +814,16 @@ acd_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct thread *td)
acd_play(cdp,
msf2lba(args->start_m, args->start_s, args->start_f),
msf2lba(args->end_m, args->end_s, args->end_f));
break;
}
break;
case CDIOCPLAYBLOCKS:
{
struct ioc_play_blocks *args = (struct ioc_play_blocks *)addr;
error = acd_play(cdp, args->blk, args->blk + args->len);
break;
}
break;
case CDIOCPLAYTRACKS:
{
@ -846,8 +847,8 @@ acd_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct thread *td)
}
error = acd_play(cdp, ntohl(cdp->toc.tab[t1].addr.lba),
ntohl(cdp->toc.tab[t2].addr.lba));
break;
}
break;
case CDIOCGETVOL:
{
@ -865,8 +866,8 @@ acd_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct thread *td)
arg->vol[1] = cdp->au.port[1].volume;
arg->vol[2] = cdp->au.port[2].volume;
arg->vol[3] = cdp->au.port[3].volume;
break;
}
break;
case CDIOCSETVOL:
{
@ -891,16 +892,17 @@ acd_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct thread *td)
cdp->au.port[2].volume = arg->vol[2] & cdp->aumask.port[2].volume;
cdp->au.port[3].volume = arg->vol[3] & cdp->aumask.port[3].volume;
error = acd_mode_select(cdp, (caddr_t)&cdp->au, sizeof(cdp->au));
break;
}
break;
case CDIOCSETPATCH:
{
struct ioc_patch *arg = (struct ioc_patch *)addr;
error = acd_setchan(cdp, arg->patch[0], arg->patch[1],
arg->patch[2], arg->patch[3]);
break;
}
break;
case CDIOCSETMONO:
error = acd_setchan(cdp, CHANNEL_0|CHANNEL_1, CHANNEL_0|CHANNEL_1, 0,0);

View File

@ -51,15 +51,15 @@ static disk_close_t afd_close;
static disk_ioctl_t afd_ioctl;
#endif
static disk_strategy_t afdstrategy;
static void afd_detach(struct ata_device *atadev);
static void afd_start(struct ata_device *atadev);
static void afd_detach(struct ata_device *);
static void afd_start(struct ata_device *);
static int afd_sense(struct afd_softc *);
static void afd_describe(struct afd_softc *);
static void afd_done(struct ata_request *);
static int afd_eject(struct afd_softc *, int);
static int afd_start_stop(struct afd_softc *, int);
static int afd_prevent_allow(struct afd_softc *, int);
static int afd_test_ready(struct ata_device *atadev);
static int afd_test_ready(struct ata_device *);
/* internal vars */
static u_int32_t afd_lun_map = 0;

View File

@ -63,8 +63,8 @@ static struct cdevsw ast_cdevsw = {
};
/* prototypes */
static void ast_detach(struct ata_device *atadev);
static void ast_start(struct ata_device *atadev);
static void ast_detach(struct ata_device *);
static void ast_start(struct ata_device *);
static int ast_sense(struct ast_softc *);
static void ast_describe(struct ast_softc *);
static void ast_done(struct ata_request *);
@ -78,8 +78,8 @@ static int ast_prevent_allow(struct ast_softc *stp, int);
static int ast_load_unload(struct ast_softc *, u_int8_t);
static int ast_rewind(struct ast_softc *);
static int ast_erase(struct ast_softc *);
static int ast_test_ready(struct ata_device *atadev);
static int ast_wait_dsc(struct ata_device *atadev, int timeout);
static int ast_test_ready(struct ata_device *);
static int ast_wait_dsc(struct ata_device *, int);
/* internal vars */
static u_int32_t ast_lun_map = 0;
@ -343,8 +343,9 @@ ast_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
g->mt_blksiz2 = 0; g->mt_blksiz3 = 0;
g->mt_comp0 = 0; g->mt_comp1 = 0;
g->mt_comp2 = 0; g->mt_comp3 = 0;
break;
}
break;
case MTIOCTOP:
{
int i;
@ -401,8 +402,9 @@ ast_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
default:
error = EINVAL;
}
break;
}
break;
case MTIOCRDSPOS:
{
struct ast_readposition position;
@ -410,8 +412,9 @@ ast_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
if ((error = ast_read_position(stp, 0, &position)))
break;
*(u_int32_t *)addr = position.tape;
break;
}
break;
case MTIOCRDHPOS:
{
struct ast_readposition position;
@ -419,14 +422,17 @@ ast_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
if ((error = ast_read_position(stp, 1, &position)))
break;
*(u_int32_t *)addr = position.tape;
break;
}
break;
case MTIOCSLOCATE:
error = ast_locate(stp, 0, *(u_int32_t *)addr);
break;
case MTIOCHLOCATE:
error = ast_locate(stp, 1, *(u_int32_t *)addr);
break;
default:
error = ENOTTY;
}