#define SECTOR_SIZE 512
-enum {
+typedef enum {
ST_NIL, /* Zero checksums */
ST_XOR, /* XOR-based checksums */
ST_CRC, /* CRC32-based checksums */
ST_MD5 /* MD5-based checksums */
-};
+} checksum_type;
-enum {
+typedef enum {
FLT_WRITE, /* write to up to two disks */
FLT_READ, /* read from one disk */
FLT_READ2 /* read from both disks */
-};
+} disk_operation;
/* Something was wrong and the disk driver has been restarted/refreshed,
* so the request needs to be redone.
* BD_PROTO: a protocol error has occurred. Refresh it.
* BD_DATA: a data error has occurred. Refresh it.
*/
-enum {
+typedef enum {
BD_NONE,
BD_DEAD,
BD_PROTO,
BD_DATA,
BD_LAST
-};
+} driver_state;
#define DRIVER_MAIN 0
#define DRIVER_BACKUP 1
#ifndef _OPTSET_H
#define _OPTSET_H
-enum {
+typedef enum {
OPT_BOOL,
OPT_STRING,
OPT_INT
-};
+} opt_type;
/* An entry for the parser of an options set. The 'os_name' field must point
* to a string, which is treated case-insensitively; the last entry of a table
*/
struct optset {
char *os_name;
- int os_type;
+ opt_type os_type;
void *os_ptr;
int os_val;
};
#include "floppy.h"
#include <timers.h>
-#include <assert.h>
#include <ibm/diskparm.h>
#include <minix/sysutil.h>
#include <minix/syslib.h>
#include "../drivers.h"
-#include <minix/keymap.h>
#include <net/hton.h>
#include <net/gen/ether.h>
#include <net/gen/eth_io.h>
#include "../drivers.h"
#include "../libdriver/driver.h"
#include <sys/ioc_memory.h>
-#include <env.h>
#include <minix/ds.h>
#include <minix/vm.h>
#include <sys/mman.h>
#include "../../kernel/config.h"
#include "../../kernel/type.h"
-#include <sys/vm.h>
#include <sys/vm_i386.h>
-#include "assert.h"
-
#include "local.h"
/* ramdisks (/dev/ram*) */
#include <string.h>
#include <unistd.h>
-char *progname;
-unsigned char buf[1024];
+static char *progname;
+static unsigned char buf[1024];
static void fatal(char *fmt, ...);
static void usage(void);
*/
#include "hermes.h"
-#include <sys/vm.h>
-#include "assert.h"
-#include <ibm/pci.h>
-#include "string.h"
-int this_proc;
+PRIVATE int this_proc;
/*****************************************************************************
* milli_delay *
#include "../drivers.h"
#include <string.h>
-#include <stddef.h>
-#include <minix/keymap.h>
#include <minix/syslib.h>
#include <minix/type.h>
#include <minix/sysutil.h>
#include <timers.h>
-#include <sys/ioc_memory.h>
#include <ibm/pci.h>
#include <minix/ds.h>
#include <minix/endpoint.h>
#include <net/gen/eth_io.h>
#include <sys/vm_i386.h>
#include <sys/types.h>
-#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include "../drivers.h"
-#include <ibm/pci.h>
#include <minix/rs.h>
#include <minix/endpoint.h>
#include <stdlib.h>
#include <stdio.h>
-#include <string.h>
#include <minix/sysutil.h>
#define PBT_INTEL_HOST 1
#include "../drivers.h"
#include "../libdriver/driver.h"
-#include <sys/ioc_memory.h>
#include <minix/type.h>
#include "assert.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include <stddef.h>
#include <minix/com.h>
#include <minix/ds.h>
-#include <minix/keymap.h>
#include <minix/syslib.h>
#include <minix/type.h>
#include <minix/sysutil.h>
#include <ibm/pci.h>
#include <sys/types.h>
-#include <fcntl.h>
#include <assert.h>
#include <unistd.h>
-#include <sys/ioc_memory.h>
#include "../../kernel/const.h"
#include "../../kernel/config.h"
#include "../../kernel/type.h"
/*===========================================================================*
* dsp_ioctl
*===========================================================================*/
-PRIVATE int dsp_ioctl(m_ptr)
-message *m_ptr;
+PRIVATE int dsp_ioctl(message *m_ptr)
{
int status;
phys_bytes user_phys;
/*===========================================================================*
* dsp_write
*===========================================================================*/
-PRIVATE void dsp_write(m_ptr)
-message *m_ptr;
+PRIVATE void dsp_write(message *m_ptr)
{
int s;
message mess;
/*===========================================================================*
* dsp_status *
*===========================================================================*/
-PRIVATE void dsp_status(m_ptr)
-message *m_ptr; /* pointer to the newly arrived message */
+PRIVATE void dsp_status(message *m_ptr)
+/* m_ptr pointer to the newly arrived message */
{
if(revivePending) {
m_ptr->m_type = DEV_REVIVE; /* build message */
/*===========================================================================*
* reply *
*===========================================================================*/
-PRIVATE void reply(code, replyee, process, status)
-int code;
-int replyee;
-int process;
-int status;
+PRIVATE void reply(int code, int replyee, int process, int status)
{
message m;
/*===========================================================================*
* dsp_command
*===========================================================================*/
-PRIVATE int dsp_command(value)
-int value;
+PRIVATE int dsp_command(int value)
{
int i, status;
/*===========================================================================*
* dsp_set_size
*===========================================================================*/
-static int dsp_set_size(size)
-unsigned int size;
+static int dsp_set_size(unsigned int size)
{
dprint("dsp_set_size(): set fragment size to %u\n", size);
/*===========================================================================*
* dsp_set_speed
*===========================================================================*/
-static int dsp_set_speed(speed)
-unsigned int speed;
+static int dsp_set_speed(unsigned int speed)
{
dprint("sb16: setting speed to %u, stereo = %d\n", speed, DspStereo);
/*===========================================================================*
* dsp_set_stereo
*===========================================================================*/
-static int dsp_set_stereo(stereo)
-unsigned int stereo;
+static int dsp_set_stereo(unsigned int stereo)
{
if(stereo) {
DspStereo = 1;
/*===========================================================================*
* dsp_set_bits
*===========================================================================*/
-static int dsp_set_bits(bits)
-unsigned int bits;
+static int dsp_set_bits(unsigned int bits)
{
/* Sanity checks */
if(bits != 8 && bits != 16) {
/*===========================================================================*
* dsp_set_sign
*===========================================================================*/
-static int dsp_set_sign(sign)
-unsigned int sign;
+static int dsp_set_sign(unsigned int sign)
{
dprint("sb16: set sign to %u\n", sign);
/*===========================================================================*
* dsp_dma_setup
*===========================================================================*/
-PRIVATE void dsp_dma_setup(address, count)
-phys_bytes address;
-int count;
+PRIVATE void dsp_dma_setup(phys_bytes address, int count)
{
pvb_pair_t pvb[9];
/*=========================================================================*
* mixer_open
*=========================================================================*/
-PRIVATE int mixer_open(m_ptr)
-message *m_ptr;
+PRIVATE int mixer_open(message *m_ptr)
{
dprint("mixer_open\n");
/*=========================================================================*
* mixer_close
*=========================================================================*/
-PRIVATE int mixer_close(m_ptr)
-message *m_ptr;
+PRIVATE int mixer_close(message *m_ptr)
{
dprint("mixer_close\n");
/*=========================================================================*
* mixer_ioctl
*=========================================================================*/
-PRIVATE int mixer_ioctl(m_ptr)
-message *m_ptr;
+PRIVATE int mixer_ioctl(message *m_ptr)
{
int status;
/*=========================================================================*
* mixer_get
*=========================================================================*/
-PRIVATE int mixer_get(reg)
-int reg;
+PRIVATE int mixer_get(int reg)
{
int i;
/*=========================================================================*
* get_set_volume *
*=========================================================================*/
-PRIVATE int get_set_volume(m_ptr, flag)
-message *m_ptr;
-int flag; /* 0 = get, 1 = set */
+PRIVATE int get_set_volume(message *m_ptr, int flag)
+/* flag 0 = get, 1 = set */
{
phys_bytes user_phys;
struct volume_level level;
/*=========================================================================*
* get_set_input *
*=========================================================================*/
-PRIVATE int get_set_input(m_ptr, flag, channel)
-message *m_ptr;
-int flag; /* 0 = get, 1 = set */
-int channel; /* 0 = left, 1 = right */
+PRIVATE int get_set_input(message *m_ptr, int flag, int channel)
+/*
+ * flag 0 = get, 1 = set
+ * channel 0 = left, 1 = right
+ */
{
phys_bytes user_phys;
struct inout_ctrl input;
/*=========================================================================*
* get_set_output *
*=========================================================================*/
-PRIVATE int get_set_output(m_ptr, flag)
-message *m_ptr;
-int flag; /* 0 = get, 1 = set */
+PRIVATE int get_set_output(message *m_ptr, int flag)
+/* flag 0 = get, 1 = set */
{
phys_bytes user_phys;
struct inout_ctrl output;
#include "../drivers.h"
#include <ibm/pci.h>
-#include <sys/vm.h>
#include <sys/vm_i386.h>
#include "ti1225.h"
/*===========================================================================*
* do_pty *
*===========================================================================*/
-PUBLIC void do_pty(tp, m_ptr)
-tty_t *tp;
-message *m_ptr;
+PUBLIC void do_pty(tty_t *tp, message *m_ptr)
{
/* Perform an open/close/read/write call on a /dev/ptypX device. */
pty_t *pp = tp->tty_priv;
/*===========================================================================*
* pty_write *
*===========================================================================*/
-PRIVATE int pty_write(tp, try)
-tty_t *tp;
-int try;
+PRIVATE int pty_write(tty_t *tp, int try)
{
/* (*dev_write)() routine for PTYs. Transfer bytes from the writer on
* /dev/ttypX to the output buffer.
/*===========================================================================*
* pty_echo *
*===========================================================================*/
-PRIVATE void pty_echo(tp, c)
-tty_t *tp;
-int c;
+PRIVATE void pty_echo(tty_t *tp, int c)
{
/* Echo one character. (Like pty_write, but only one character, optionally.) */
/*===========================================================================*
* pty_start *
*===========================================================================*/
-PRIVATE void pty_start(pp)
-pty_t *pp;
+PRIVATE void pty_start(pty_t *pp)
{
/* Transfer bytes written to the output buffer to the PTY reader. */
int count;
/*===========================================================================*
* pty_finish *
*===========================================================================*/
-PRIVATE void pty_finish(pp)
-pty_t *pp;
+PRIVATE void pty_finish(pty_t *pp)
{
/* Finish the read request of a PTY reader if there is at least one byte
* transferred.
/*===========================================================================*
* pty_read *
*===========================================================================*/
-PRIVATE int pty_read(tp, try)
-tty_t *tp;
-int try;
+PRIVATE int pty_read(tty_t *tp, int try)
{
/* Offer bytes from the PTY writer for input on the TTY. (Do it one byte at
* a time, 99% of the writes will be for one byte, so no sense in being smart.)
/*===========================================================================*
* pty_close *
*===========================================================================*/
-PRIVATE int pty_close(tp, try)
-tty_t *tp;
-int try;
+PRIVATE int pty_close(tty_t *tp, int try)
{
/* The tty side has closed, so shut down the pty side. */
pty_t *pp = tp->tty_priv;
/*===========================================================================*
* pty_icancel *
*===========================================================================*/
-PRIVATE int pty_icancel(tp, try)
-tty_t *tp;
-int try;
+PRIVATE int pty_icancel(tty_t *tp, int try)
{
/* Discard waiting input. */
pty_t *pp = tp->tty_priv;
/*===========================================================================*
* pty_ocancel *
*===========================================================================*/
-PRIVATE int pty_ocancel(tp, try)
-tty_t *tp;
-int try;
+PRIVATE int pty_ocancel(tty_t *tp, int try)
{
/* Drain the output buffer. */
pty_t *pp = tp->tty_priv;
/*===========================================================================*
* pty_init *
*===========================================================================*/
-PUBLIC void pty_init(tp)
-tty_t *tp;
+PUBLIC void pty_init(tty_t *tp)
{
pty_t *pp;
int line;
/*===========================================================================*
* rs_write *
*===========================================================================*/
-PRIVATE int rs_write(tp, try)
-register tty_t *tp;
-int try;
+PRIVATE int rs_write(register tty_t *tp, int try)
{
/* (*devwrite)() routine for RS232. */
/*===========================================================================*
* rs_ioctl *
*===========================================================================*/
-PRIVATE int rs_ioctl(tp, dummy)
-tty_t *tp; /* which TTY */
-int dummy;
+PRIVATE int rs_ioctl(tty_t *tp, int dummy)
+/* tp; which TTY */
{
/* Reconfigure the line as soon as the output has drained. */
rs232_t *rs = tp->tty_priv;
/*===========================================================================*
* rs_config *
*===========================================================================*/
-PRIVATE void rs_config(rs)
-rs232_t *rs; /* which line */
+PRIVATE void rs_config(rs232_t *rs)
+/* rs which line */
{
/* Set various line control parameters for RS232 I/O.
* If DataBits == 5 and StopBits == 2, 8250 will generate 1.5 stop bits.
/*===========================================================================*
* rs_init *
*===========================================================================*/
-PUBLIC void rs_init(tp)
-tty_t *tp; /* which TTY */
+PUBLIC void rs_init(tty_t *tp)
+/* tp which TTY */
{
unsigned long dummy;
/* Initialize RS232 for one line. */
/*===========================================================================*
* rs_interrupt *
*===========================================================================*/
-PUBLIC void rs_interrupt(m)
-message *m; /* which TTY */
+PUBLIC void rs_interrupt(message *m)
{
unsigned long irq_set;
int i;
/*===========================================================================*
* rs_icancel *
*===========================================================================*/
-PRIVATE int rs_icancel(tp, dummy)
-tty_t *tp; /* which TTY */
-int dummy;
+PRIVATE int rs_icancel(tty_t *tp, int dummy)
{
/* Cancel waiting input. */
rs232_t *rs = tp->tty_priv;
/*===========================================================================*
* rs_ocancel *
*===========================================================================*/
-PRIVATE int rs_ocancel(tp, dummy)
-tty_t *tp; /* which TTY */
-int dummy;
+PRIVATE int rs_ocancel(tty_t *tp, int dummy)
{
/* Cancel pending output. */
rs232_t *rs = tp->tty_priv;
/*===========================================================================*
* rs_read *
*===========================================================================*/
-PRIVATE int rs_read(tp, try)
-tty_t *tp; /* which tty */
-int try;
+PRIVATE int rs_read(tty_t *tp, int try)
{
/* Process characters from the circular input buffer. */
/*===========================================================================*
* rs_ostart *
*===========================================================================*/
-PRIVATE void rs_ostart(rs)
-rs232_t *rs; /* which rs line */
+PRIVATE void rs_ostart(rs232_t *rs)
{
/* Tell RS232 there is something waiting in the output buffer. */
/*===========================================================================*
* rs_break *
*===========================================================================*/
-PRIVATE int rs_break(tp, dummy)
-tty_t *tp; /* which tty */
-int dummy;
+PRIVATE int rs_break(tty_t *tp, int dummy)
{
/* Generate a break condition by setting the BREAK bit for 0.4 sec. */
rs232_t *rs = tp->tty_priv;
/*===========================================================================*
* rs_close *
*===========================================================================*/
-PRIVATE int rs_close(tp, dummy)
-tty_t *tp; /* which tty */
-int dummy;
+PRIVATE int rs_close(tty_t *tp, int dummy)
{
/* The line is closed; optionally hang up. */
rs232_t *rs = tp->tty_priv;
/*===========================================================================*
* rs232_handler *
*===========================================================================*/
-PRIVATE void rs232_handler(rs)
-struct rs232 *rs;
+PRIVATE void rs232_handler(struct rs232 *rs)
{
/* Interrupt hander for RS232. */
/*===========================================================================*
* in_int *
*===========================================================================*/
-PRIVATE void in_int(rs)
-register rs232_t *rs; /* line with input interrupt */
+PRIVATE void in_int(register rs232_t *rs)
+/* rs line with input interrupt */
{
/* Read the data which just arrived.
* If it is the oxoff char, clear OSWREADY, else if OSWREADY was clear, set
/*===========================================================================*
* line_int *
*===========================================================================*/
-PRIVATE void line_int(rs)
-register rs232_t *rs; /* line with line status interrupt */
+PRIVATE void line_int(register rs232_t *rs)
+/* rs line with line status interrupt */
{
/* Check for and record errors. */
- unsigned long s;
+ unsigned long s;
sys_inb(rs->line_status_port, &s);
rs->lstatus = s;
if (rs->lstatus & LS_FRAMING_ERR) ++rs->framing_errors;
/*===========================================================================*
* modem_int *
*===========================================================================*/
-PRIVATE void modem_int(rs)
-register rs232_t *rs; /* line with modem interrupt */
+PRIVATE void modem_int(register rs232_t *rs)
+/* rs line with modem interrupt */
{
/* Get possibly new device-ready status, and clear ODEVREADY if necessary.
* If the device just became ready, restart output.
/*===========================================================================*
* out_int *
*===========================================================================*/
-PRIVATE void out_int(rs)
-register rs232_t *rs; /* line with output interrupt */
+PRIVATE void out_int(register rs232_t *rs)
+/* rs; line with output interrupt */
{
/* If there is output to do and everything is ready, do it (local device is
* known ready).