Deleted Added
full compact
linux_ioctl.c (140214) linux_ioctl.c (141031)
1/*-
2 * Copyright (c) 1994-1995 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 13 unchanged lines hidden (view full) ---

22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1994-1995 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 13 unchanged lines hidden (view full) ---

22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/sys/compat/linux/linux_ioctl.c 140214 2005-01-14 04:44:56Z obrien $");
30__FBSDID("$FreeBSD: head/sys/compat/linux/linux_ioctl.c 141031 2005-01-30 08:12:37Z sobomax $");
31
32#include <sys/param.h>
33#include <sys/systm.h>
34#include <sys/sysproto.h>
35#include <sys/cdio.h>
36#include <sys/dvdio.h>
37#include <sys/conf.h>
38#include <sys/disk.h>

--- 1446 unchanged lines hidden (view full) ---

1485 error = (ioctl(td, (struct ioctl_args *)args));
1486 break;
1487
1488 /* LINUX_CDROMVOLCTRL */
1489
1490 case LINUX_CDROMSUBCHNL: {
1491 struct linux_cdrom_subchnl sc;
1492 struct ioc_read_subchannel bsdsc;
31
32#include <sys/param.h>
33#include <sys/systm.h>
34#include <sys/sysproto.h>
35#include <sys/cdio.h>
36#include <sys/dvdio.h>
37#include <sys/conf.h>
38#include <sys/disk.h>

--- 1446 unchanged lines hidden (view full) ---

1485 error = (ioctl(td, (struct ioctl_args *)args));
1486 break;
1487
1488 /* LINUX_CDROMVOLCTRL */
1489
1490 case LINUX_CDROMSUBCHNL: {
1491 struct linux_cdrom_subchnl sc;
1492 struct ioc_read_subchannel bsdsc;
1493 struct cd_sub_channel_info *bsdinfo;
1494 caddr_t sg = stackgap_init();
1495 bsdinfo = stackgap_alloc(&sg, sizeof(*bsdinfo));
1493 struct cd_sub_channel_info bsdinfo;
1494
1496 bsdsc.address_format = CD_LBA_FORMAT;
1497 bsdsc.data_format = CD_CURRENT_POSITION;
1498 bsdsc.track = 0;
1495 bsdsc.address_format = CD_LBA_FORMAT;
1496 bsdsc.data_format = CD_CURRENT_POSITION;
1497 bsdsc.track = 0;
1499 bsdsc.data_len = sizeof(*bsdinfo);
1500 bsdsc.data = bsdinfo;
1501 error = fo_ioctl(fp, CDIOCREADSUBCHANNEL, (caddr_t)&bsdsc,
1502 td->td_ucred, td);
1498 bsdsc.data_len = sizeof(bsdinfo);
1499 bsdsc.data = &bsdinfo;
1500 error = fo_ioctl(fp, CDIOCREADSUBCHANNEL_SYSSPACE,
1501 (caddr_t)&bsdsc, td->td_ucred, td);
1503 if (error)
1504 break;
1505 error = copyin((void *)args->arg, &sc, sizeof(sc));
1506 if (error)
1507 break;
1502 if (error)
1503 break;
1504 error = copyin((void *)args->arg, &sc, sizeof(sc));
1505 if (error)
1506 break;
1508 sc.cdsc_audiostatus = bsdinfo->header.audio_status;
1509 sc.cdsc_adr = bsdinfo->what.position.addr_type;
1510 sc.cdsc_ctrl = bsdinfo->what.position.control;
1511 sc.cdsc_trk = bsdinfo->what.position.track_number;
1512 sc.cdsc_ind = bsdinfo->what.position.index_number;
1507 sc.cdsc_audiostatus = bsdinfo.header.audio_status;
1508 sc.cdsc_adr = bsdinfo.what.position.addr_type;
1509 sc.cdsc_ctrl = bsdinfo.what.position.control;
1510 sc.cdsc_trk = bsdinfo.what.position.track_number;
1511 sc.cdsc_ind = bsdinfo.what.position.index_number;
1513 set_linux_cdrom_addr(&sc.cdsc_absaddr, sc.cdsc_format,
1512 set_linux_cdrom_addr(&sc.cdsc_absaddr, sc.cdsc_format,
1514 bsdinfo->what.position.absaddr.lba);
1513 bsdinfo.what.position.absaddr.lba);
1515 set_linux_cdrom_addr(&sc.cdsc_reladdr, sc.cdsc_format,
1514 set_linux_cdrom_addr(&sc.cdsc_reladdr, sc.cdsc_format,
1516 bsdinfo->what.position.reladdr.lba);
1515 bsdinfo.what.position.reladdr.lba);
1517 error = copyout(&sc, (void *)args->arg, sizeof(sc));
1518 break;
1519 }
1520
1521 /* LINUX_CDROMREADMODE2 */
1522 /* LINUX_CDROMREADMODE1 */
1523 /* LINUX_CDROMREADAUDIO */
1524 /* LINUX_CDROMEJECT_SW */

--- 1080 unchanged lines hidden ---
1516 error = copyout(&sc, (void *)args->arg, sizeof(sc));
1517 break;
1518 }
1519
1520 /* LINUX_CDROMREADMODE2 */
1521 /* LINUX_CDROMREADMODE1 */
1522 /* LINUX_CDROMREADAUDIO */
1523 /* LINUX_CDROMEJECT_SW */

--- 1080 unchanged lines hidden ---