Removed lots of unused variables.
#include "at_wini.h"
#include <minix/sysutil.h>
-#include <minix/keymap.h>
#include <minix/type.h>
#include <minix/endpoint.h>
#include <sys/ioc_disk.h>
/* Any non-compat drives? */
if (raid || (interface & (ATA_IF_NOTCOMPAT1 | ATA_IF_NOTCOMPAT2))) {
- int s;
-
if (w_next_drive >= MAX_DRIVES)
{
/* We can't accept more drives, but have to search for
w_instance, devind);
continue;
}
- if ((s=sys_irqsetpolicy(irq, 0, &irq_hook)) != OK) {
+ if (sys_irqsetpolicy(irq, 0, &irq_hook) != OK) {
printf("atapci: couldn't set IRQ policy %d\n", irq);
continue;
}
- if ((s=sys_irqenable(&irq_hook)) != OK) {
+ if (sys_irqenable(&irq_hook) != OK) {
printf("atapci: couldn't enable IRQ line %d\n", irq);
continue;
}
*===========================================================================*/
PRIVATE struct device *w_prepare(int device)
{
-/* Prepare for I/O on a device. */
-struct wini *prev_wn;
-prev_wn = w_wn;
+ /* Prepare for I/O on a device. */
w_device = device;
if (device < NR_MINORS) { /* d0, d0p[0-3], d1, ... */
#include <stdlib.h>
#include <stdio.h>
-#include <string.h>
-#include <minix/sysutil.h>
#include <errno.h>
&(level->left), &(level->right), 0x1f, 1);
break;
case Speaker:
- cmd = AC97_PC_BEEP_VOLUME;
return EINVAL;
- break;
case Treble:
cmd = AC97_MASTER_TONE;
get_volume(&left, &right, cmd);
break;
case Dac:
return EINVAL;
- break;
case Fm:
cmd = AC97_PCM_OUT_VOLUME;
convert(level->left, level->right, 0x1f, &left, &right, 0x1f, 0);
convert(level->left, level->right, 0x1f, &left, &right, 0x1f, 1);
break;
case Speaker:
- cmd = AC97_PC_BEEP_VOLUME;
return EINVAL;
- break;
case Treble:
- cmd = AC97_MASTER_TONE;
return EINVAL;
- break;
case Bass:
- cmd = AC97_MASTER_TONE;
return EINVAL;
- break;
default:
return EINVAL;
}
#include <stdlib.h>
#include <stdio.h>
-#include <string.h>
-#include <minix/sysutil.h>
#include <errno.h>
#include "../../drivers.h"
#include <sys/types.h>
-#include <time.h>
#include "pci_helper.h"
int WaitBitd (int paddr, int bitno, int state, long tmout)
{
-unsigned long val, mask;
+ unsigned long mask;
mask = 1UL << bitno;
tmout *= 5000;
if(state) {
while(tmout-- > 0) {
- if((val = pci_inl(paddr)) & mask) {
+ if(pci_inl(paddr) & mask) {
return 0;
}
}
} else {
while(tmout-- > 0) {
- if(!((val = pci_inl(paddr)) & mask)) {
+ if(!(pci_inl(paddr) & mask)) {
return 0;
}
}
PRIVATE void msg_hardware(void) {
u32_t i;
- int j = 0;
dprint("%s: handling hardware message\n", drv.DriverName);
PRIVATE void handle_int_write(int sub_dev_nr)
{
sub_dev_t *sub_dev_ptr;
- int r;
sub_dev_ptr = &sub_dev[sub_dev_nr];
drv_reenable_int(sub_dev_nr);
#if 0
/* reenable irq_hook*/
- if ((r=sys_irqenable(&irq_hook_id)) != OK) {
+ if (sys_irqenable(&irq_hook_id != OK) {
error("%s Couldn't enable IRQ\n", drv.DriverName);
}
#endif
/* handle interrupt for specified sub device; DmaMode == DEV_READ_S */
PRIVATE void handle_int_read(int sub_dev_nr)
{
- sub_dev_t *sub_dev_ptr; int r,i;
+ sub_dev_t *sub_dev_ptr;
sub_dev_ptr = &sub_dev[sub_dev_nr];
#if 0
/* reenable irq_hook*/
- if ((r=sys_irqenable(&irq_hook_id)) != OK) {
+ if (sys_irqenable(&irq_hook_id) != OK) {
error("%s: Couldn't reenable IRQ", drv.DriverName);
}
#endif
PRIVATE int get_started(sub_dev_t *sub_dev_ptr) {
- u32_t i;char c;
+ u32_t i;
/* enable interrupt messages from MINIX */
if ((i=sys_irqenable(&irq_hook_id)) != OK) {
PUBLIC int drv_init_hw(void) {
- int i, s;
+ int i;
int DspVersion[2];
dprint("drv_init_hw():\n");
PUBLIC int dsp_command(int value) {
- int i, status;
+ int i;
for (i = 0; i < SB_TIMEOUT; i++) {
if((sb16_inb(DSP_STATUS) & 0x80) == 0) {
/*============================================================================*
* w_other *
*============================================================================*/
-PRIVATE int w_other(dr, m)
-struct driver *dr;
-message *m;
+PRIVATE int w_other(struct driver *dr, message *m)
{
- int r, timeout, prev;
+ int r;
if (m->m_type != DEV_IOCTL_S )
return EINVAL;
size_t size;
void *dst;
{
- int r;
-
offset = page * DP_PAGESIZE + offset;
memcpy(dst, dep->de_locmem + offset, size);
int nic_addr;
vir_bytes count;
{
- vir_bytes vir_hw, vir_user;
+ vir_bytes vir_hw;
int bytes, i, r;
vir_hw = (vir_bytes)dep->de_locmem + nic_addr;
int nic_addr;
vir_bytes count;
{
- vir_bytes vir_hw, vir_user;
+ vir_bytes vir_hw;
int bytes, i, r;
vir_hw = (vir_bytes)dep->de_locmem + nic_addr;
int nic_addr;
vir_bytes count;
{
- phys_bytes phys_user;
int bytes, i;
outb_reg0(dep, DP_ISR, ISR_RDC);
int nic_addr;
vir_bytes count;
{
- phys_bytes phys_user;
int bytes, i, r;
outb_reg0(dep, DP_ISR, ISR_RDC);
vir_bytes offset;
vir_bytes count;
{
- vir_bytes vir_hw, vir_user;
int bytes, i, r;
- vir_hw = (vir_bytes)dep->de_locmem + nic_addr;
+ vir_bytes vir_hw = (vir_bytes) (dep->de_locmem + nic_addr);
i= 0;
while (count > 0)
vir_bytes offset;
vir_bytes count;
{
- vir_bytes vir_hw, vir_user;
+ vir_bytes vir_hw;
int bytes, i, r;
vir_hw = (vir_bytes)dep->de_locmem + nic_addr;
vir_bytes offset;
vir_bytes count;
{
- phys_bytes phys_user;
int bytes, i;
outb_reg0(dep, DP_RBCR0, count & 0xFF);
vir_bytes offset;
vir_bytes count;
{
- phys_bytes phys_user;
int bytes, i, r;
outb_reg0(dep, DP_RBCR0, count & 0xFF);
PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
{
/* Initialize the dpeth driver. */
- dpeth_t *dep;
int rc, fkeys, sfkeys, tasknr;
(progname=strrchr(env_argv[0],'/')) ? progname++ : (progname=env_argv[0]);
*/
PUBLIC void mem2user(dpeth_t *dep, buff_t *rxbuff)
{
- phys_bytes phys_user;
int bytes, ix = 0;
iovec_dat_s_t *iovp = &dep->de_read_iovec;
int r, pktsize = rxbuff->size;
*/
PUBLIC void user2mem(dpeth_t *dep, buff_t *txbuff)
{
- phys_bytes phys_user;
int bytes, ix = 0;
iovec_dat_s_t *iovp = &dep->de_write_iovec;
int r, pktsize = txbuff->size;
PRIVATE char *progname;
PRIVATE e1000_t e1000_table[E1000_PORT_NR];
-_PROTOTYPE( PRIVATE int e1000_init, (message *mp) );
+_PROTOTYPE( PRIVATE void e1000_init, (message *mp) );
_PROTOTYPE( PRIVATE void e1000_init_pci, (void) );
_PROTOTYPE( PRIVATE int e1000_probe, (e1000_t *e) );
_PROTOTYPE( PRIVATE int e1000_init_hw, (e1000_t *e) );
/*===========================================================================*
* e1000_init *
*===========================================================================*/
-PRIVATE int e1000_init(mp)
-message *mp;
+PRIVATE void e1000_init(message *mp)
{
static int first_time = 1;
message reply_mess;
/*===========================================================================*
* e1000_probe *
*===========================================================================*/
-PRIVATE int e1000_probe(e)
-e1000_t *e;
+PRIVATE int e1000_probe(e1000_t *e)
{
int i, r, devind;
u16_t vid, did;
u32_t status[2];
u32_t gfpreg, sector_base_addr, sector_end_addr;
- char *dname, *str;
+ char *dname;
E1000_DEBUG(3, ("%s: probe()\n", e->name));
PRIVATE void e1000_signal(void)
{
sigset_t sigset;
- int sig;
E1000_DEBUG(3, ("e1000: signal()\n"));
{
/* Create memory grants, either to one or to both drivers.
*/
- cp_grant_id_t gid;
int count, access;
count = 0;
vectors[1], &sizes[1]);
}
}
+ return count;
}
/*===========================================================================*