diff options
Diffstat (limited to 'misc/libcdio')
-rw-r--r-- | misc/libcdio/Makefile | 7 | ||||
-rw-r--r-- | misc/libcdio/PLIST | 6 | ||||
-rw-r--r-- | misc/libcdio/distinfo | 7 | ||||
-rw-r--r-- | misc/libcdio/files/_cdio_netbsd.c | 63 | ||||
-rw-r--r-- | misc/libcdio/patches/patch-ab | 22 |
5 files changed, 72 insertions, 33 deletions
diff --git a/misc/libcdio/Makefile b/misc/libcdio/Makefile index 8e35c90304a..42eeb943970 100644 --- a/misc/libcdio/Makefile +++ b/misc/libcdio/Makefile @@ -1,8 +1,7 @@ -# $NetBSD: Makefile,v 1.13 2004/10/03 00:13:00 tv Exp $ +# $NetBSD: Makefile,v 1.14 2004/10/05 14:23:18 drochner Exp $ # -DISTNAME= libcdio-0.68 -PKGREVISION= 1 +DISTNAME= libcdio-0.70 CATEGORIES= misc MASTER_SITES= ${MASTER_SITE_GNU:=libcdio/} @@ -27,7 +26,7 @@ INFO_FILES= libcdio.info .if ${OPSYS} == "NetBSD" # XXX we just replace the freebsd module so save patches pre-patch: - ${CP} ${FILESDIR}/_cdio_netbsd.c ${WRKSRC}/lib/_cdio_freebsd.c + ${CP} ${FILESDIR}/_cdio_netbsd.c ${WRKSRC}/lib/FreeBSD/freebsd.c .endif .include "../../devel/pkgconfig/buildlink3.mk" diff --git a/misc/libcdio/PLIST b/misc/libcdio/PLIST index d8a3593ccba..b9dbe6b04cb 100644 --- a/misc/libcdio/PLIST +++ b/misc/libcdio/PLIST @@ -1,12 +1,16 @@ -@comment $NetBSD: PLIST,v 1.5 2004/09/22 08:09:44 jlam Exp $ +@comment $NetBSD: PLIST,v 1.6 2004/10/05 14:23:18 drochner Exp $ +bin/cd-drive bin/cd-info bin/cd-read bin/iso-info bin/iso-read include/cdio/cd_types.h include/cdio/cdio.h +include/cdio/cdtext.h +include/cdio/dvd.h include/cdio/iso9660.h include/cdio/logging.h +include/cdio/scsi_mmc.h include/cdio/sector.h include/cdio/types.h include/cdio/util.h diff --git a/misc/libcdio/distinfo b/misc/libcdio/distinfo index b84a6477ab9..77b3f2e8348 100644 --- a/misc/libcdio/distinfo +++ b/misc/libcdio/distinfo @@ -1,6 +1,5 @@ -$NetBSD: distinfo,v 1.3 2004/04/19 18:08:27 drochner Exp $ +$NetBSD: distinfo,v 1.4 2004/10/05 14:23:18 drochner Exp $ -SHA1 (libcdio-0.68.tar.gz) = c3935f6fd66d6f6fe1451862d5281fd292eabb89 -Size (libcdio-0.68.tar.gz) = 1253630 bytes +SHA1 (libcdio-0.70.tar.gz) = 57d45525fc5dc8de8c0dc9fd574d90cb534b36df +Size (libcdio-0.70.tar.gz) = 1474322 bytes SHA1 (patch-aa) = ebda7a5453404e6adf4755f768a5293ca9871878 -SHA1 (patch-ab) = 2d937aa72b392264777c24fdc454d7863b5e8544 diff --git a/misc/libcdio/files/_cdio_netbsd.c b/misc/libcdio/files/_cdio_netbsd.c index 9320b452ef0..57cbf367d00 100644 --- a/misc/libcdio/files/_cdio_netbsd.c +++ b/misc/libcdio/files/_cdio_netbsd.c @@ -1,4 +1,4 @@ -/* $NetBSD: _cdio_netbsd.c,v 1.1 2004/04/08 17:40:06 drochner Exp $ */ +/* $NetBSD: _cdio_netbsd.c,v 1.2 2004/10/05 14:23:18 drochner Exp $ */ /* * Copyright (c) 2003 @@ -73,6 +73,35 @@ typedef struct { } _img_private_t; static int +run_scsi_cmd_freebsd(const void *p_user_data, unsigned int i_timeout_ms, + unsigned int i_cdb, const scsi_mmc_cdb_t *p_cdb, + scsi_mmc_direction_t e_direction, + unsigned int i_buf, void *p_buf ) +{ + const _img_private_t *_obj = p_user_data; + scsireq_t req; + + memset(&req, 0, sizeof(req)); + memcpy(&req.cmd[0], p_cdb, i_cdb); + req.cmdlen = i_cdb; + req.datalen = i_buf; + req.databuf = p_buf; + req.timeout = i_timeout_ms; + req.flags = e_direction == SCSI_MMC_DATA_READ ? SCCMD_READ : SCCMD_WRITE; + + if (ioctl(_obj->gen.fd, SCIOCCOMMAND, &req) < 0) { + perror("SCIOCCOMMAND"); + return -1; + } + if (req.retsts != SCCMD_OK) { + fprintf(stderr, "SCIOCCOMMAND sts %d\n", req.retsts); + return -1; + } + + return 0; +} + +static int _cdio_read_audio_sectors(void *user_data, void *data, lsn_t lsn, unsigned int nblocks) { @@ -241,6 +270,13 @@ _cdio_read_toc(_img_private_t *_obj) return true; } +static bool +read_toc_freebsd (void *p_user_data) +{ + + return _cdio_read_toc(p_user_data); +} + static int _cdio_read_discinfo(_img_private_t *_obj) { @@ -437,9 +473,17 @@ _cdio_get_track_msf(void *user_data, track_t track_num, msf_t *msf) return true; } +char ** +cdio_get_devices_freebsd (void) +{ + + return 0; +} + char * cdio_get_default_device_freebsd() { + return strdup(DEFAULT_CDIO_DEVICE); } @@ -447,8 +491,13 @@ static cdio_funcs _funcs = { .eject_media = _cdio_eject_media, .free = cdio_generic_free, .get_arg = _cdio_get_arg, + .get_cdtext = get_cdtext_generic, .get_default_device = cdio_get_default_device_freebsd, + .get_devices = cdio_get_devices_freebsd, + .get_discmode = get_discmode_generic, + .get_drive_cap = scsi_mmc_get_drive_cap_generic, .get_first_track_num= _cdio_get_first_track_num, + .get_mcn = scsi_mmc_get_mcn_generic, .get_num_tracks = _cdio_get_num_tracks, .get_track_format = _cdio_get_track_format, .get_track_green = _cdio_get_track_green, @@ -459,6 +508,8 @@ static cdio_funcs _funcs = { .read_audio_sectors = _cdio_read_audio_sectors, .read_mode2_sector = _cdio_read_mode2_sector, .read_mode2_sectors = _cdio_read_mode2_sectors, + .read_toc = read_toc_freebsd, + .run_scsi_mmc_cmd = run_scsi_cmd_freebsd, .set_arg = _cdio_set_arg, .stat_size = _cdio_stat_size }; @@ -478,7 +529,7 @@ cdio_open_freebsd(const char *source_name) _cdio_set_arg(_data, "source", (source_name ? source_name : DEFAULT_CDIO_DEVICE)); - ret = cdio_new(_data, &_funcs); + ret = cdio_new(&_data->gen, &_funcs); if (!ret) return NULL; @@ -490,8 +541,16 @@ cdio_open_freebsd(const char *source_name) } } +CdIo * +cdio_open_am_freebsd(const char *source_name, const char *am) +{ + + return (cdio_open_freebsd(source_name)); +} + bool cdio_have_freebsd(void) { + return true; } diff --git a/misc/libcdio/patches/patch-ab b/misc/libcdio/patches/patch-ab deleted file mode 100644 index f4e56e9a3f7..00000000000 --- a/misc/libcdio/patches/patch-ab +++ /dev/null @@ -1,22 +0,0 @@ -$NetBSD: patch-ab,v 1.1 2004/04/19 18:08:27 drochner Exp $ - ---- src/cd-info.c.orig 2004-03-20 22:46:57.000000000 +0000 -+++ src/cd-info.c 2004-04-18 17:50:54.000000000 +0000 -@@ -123,7 +123,7 @@ - int opt; - - struct poptOption optionsTable[] = { -- {"access-mode", 'a', POPT_ARG_STRING, &opts.access_mode, 0, -+ {"access-mode", 'm', POPT_ARG_STRING, &opts.access_mode, 0, - "Set CD access methed"}, - - {"debug", 'd', POPT_ARG_INT, &opts.debug_level, 0, -@@ -426,7 +426,7 @@ - matches = cddb_query(conn, disc); - - if (-1 == matches) -- printf("%s: %s\n", program_name, cddb_error_str(errno)); -+ printf("%s: %s\n", program_name, cddb_error_str(cddb_errno(conn))); - else { - printf("%s: Found %d matches in CDDB\n", program_name, matches); - for (i=1; i<=matches; i++) { |