Exemplo n.º 1
0
static int
sscape_coproc_ioctl (void *dev_info, unsigned int cmd, caddr_t arg, int local)
{

  switch (cmd)
    {
    case SNDCTL_COPR_RESET:
      sscape_coproc_reset (dev_info);
      return 0;
      break;

    case SNDCTL_COPR_LOAD:
      {
	copr_buffer    *buf;
	int             err;

	buf = (copr_buffer *) vmalloc (sizeof (copr_buffer));
	if (buf == NULL)
	  return -(ENOSPC);
	memcpy_fromfs ((char *) buf, &((char *) arg)[0], sizeof (*buf));
	err = download_boot_block (dev_info, buf);
	vfree (buf);
	return err;
      }
      break;

    default:
      return -(EINVAL);
    }

}
Exemplo n.º 2
0
static int sscape_coproc_ioctl(void *dev_info, unsigned int cmd, caddr_t arg, int local)
{
	copr_buffer *buf;
	int err;

	switch (cmd) 
	{
		case SNDCTL_COPR_RESET:
			sscape_coproc_reset(dev_info);
			return 0;

		case SNDCTL_COPR_LOAD:
			buf = (copr_buffer *) vmalloc(sizeof(copr_buffer));
			if (buf == NULL)
				return -ENOSPC;
			if (copy_from_user(buf, arg, sizeof(copr_buffer))) 
			{
				vfree(buf);
				return -EFAULT;
			}
			err = download_boot_block(dev_info, buf);
			vfree(buf);
			return err;
		
		default:
			return -EINVAL;
	}
}
Exemplo n.º 3
0
static int
sscape_coproc_ioctl(void *dev_info, u_int cmd, ioctl_arg arg, int local)
{

    switch (cmd) {
    case SNDCTL_COPR_RESET:
	sscape_coproc_reset(dev_info);
	return 0;
	break;

    case SNDCTL_COPR_LOAD:
	{
	    copr_buffer    *buf;
	    int             err;

	    buf = (copr_buffer *) malloc(sizeof(copr_buffer), M_TEMP, M_WAITOK);
	    if (buf == NULL)
		return -(ENOSPC);
	    bcopy(&(((char *) arg)[0]), (char *) buf, sizeof(*buf));
	    err = download_boot_block(dev_info, buf);
	    free(buf, M_TEMP);
	    return err;
	}
	break;

    default:
	return -(EINVAL);
    }

}