diff options
author | germeier <germeier> | 2004-04-19 12:19:19 +0000 |
---|---|---|
committer | germeier <germeier> | 2004-04-19 12:19:19 +0000 |
commit | 8239e1579a40a1355a74ba911a9db1d6d7405bfe (patch) | |
tree | 765ff95e08cba33b17e49e0078a17180ff284922 | |
parent | 5961b46c312996207fb13d22c02bd3326ea48eb4 (diff) | |
download | mpiosh-8239e1579a40a1355a74ba911a9db1d6d7405bfe.tar.gz mpiosh-8239e1579a40a1355a74ba911a9db1d6d7405bfe.tar.bz2 mpiosh-8239e1579a40a1355a74ba911a9db1d6d7405bfe.zip |
several debug messages clean ups
removed #ifdefs HAVE_USB (is mandatory!)
added #ifdefs USE_KMODULE (is deprecated but can still be used)
added hotplug infrastructure
changed version to 0.7.1-pre1
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | configure.in | 52 | ||||
-rw-r--r-- | libmpio/defs.h | 6 | ||||
-rw-r--r-- | libmpio/src/io.c | 136 | ||||
-rw-r--r-- | libmpio/src/mpio.c | 12 | ||||
-rw-r--r-- | libmpio/src/smartmedia.c | 14 | ||||
-rw-r--r-- | mpio.spec.in | 3 |
8 files changed, 151 insertions, 90 deletions
@@ -1,3 +1,19 @@ +2004-04-19 Markus Germeier <mager@tzi.de> + * added hotplug infrastructure to the project + - defaults to root:root 0666 + - change with --with-{user,group,perm}= + - minor clean ups + * changed version to 0.7.1-pre1 + +2004-04-19 Markus Germeier <mager@tzi.de> + * libmpio/src/smartmedia.c: + libmpio/src/io.c: + fixed debug outputs and copyright notice + * removed "#ifdef HAVE_USB"s + libusb is mandatory now! + * added "#ifdef USE_KMODULE" + * removed noisy and misleading debug messages + 2004-03-25 Markus Germeier <mager@tzi.de> * Don't BuildRequire libusb-devel because it does not exist on SuSE 9.0 diff --git a/Makefile.am b/Makefile.am index 97b52e6..c2acfbc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,3 @@ -SUBDIRS=@MPIO_KERNEL@ libmpio mpiosh etc tools +SUBDIRS=@MPIO_KERNEL@ libmpio mpiosh etc tools hotplug EXTRA_DIST=mpio.spec diff --git a/configure.in b/configure.in index 52deca0..5dc4b30 100644 --- a/configure.in +++ b/configure.in @@ -10,7 +10,7 @@ dnl AM_CONFIG_HEADER(src/config.h) AC_CANONICAL_SYSTEM() AC_MSG_RESULT(Building for a ${host} host.) -AM_INIT_AUTOMAKE(mpio, 0.7.1-1.2004032501) +AM_INIT_AUTOMAKE(mpio, 0.7.1_pre1-1) dnl build release variable RELEASE=`echo $VERSION | cut -d- -f2` @@ -47,7 +47,6 @@ AC_DEFUN([TEST_MPLIB], [ac_cv_use_mplib=$withval], [ac_cv_use_mplib=yes]) AC_CACHE_CHECK([whether to use mplib], [ac_cv_use_mplib], [ac_cv_use_mplib=yes])]) - TEST_MPLIB if test "$ac_cv_use_mplib" = yes; then @@ -78,7 +77,6 @@ if test -n "${LIBUSB_CONFIG}"; then LDFLAGS="$LDFLAGS_orig"]) CPPFLAGS="$CPPFLAGS_save" fi -set > /tmp/set.foo # This 'test' call uses non-standard syntax and will fail on most # systems, but it's just informational so any warning can be ignored. @@ -88,6 +86,7 @@ if test "$LIBUSB_VER" \< "0.1.7"; then *** http://sourceforge.net/projects/libusb/ *** If you cannot find the appropriate version, try CVS ]) + exit 1 fi case "$usb_msg" in @@ -98,6 +97,50 @@ esac AC_SUBST(USB_CFLAGS) AC_SUBST(USB_LIBS) +dnl --- check/set user and permissions for accessing the player + +dnl 1. user + +AC_DEFUN([TEST_USER], +[AC_ARG_WITH([user], + AC_HELP_STRING([--with-user=USER], + [user to access the player]), + [ac_cv_use_user=$withval], [ac_cv_use_user=root]) +AC_CACHE_CHECK([user to access the player], + [ac_cv_use_user], [ac_cv_use_user=root])]) + +TEST_USER +MPIOUSER=$ac_cv_use_user +AC_SUBST(MPIOUSER) + +dnl 2. group + +AC_DEFUN([TEST_GROUP], +[AC_ARG_WITH([group], + AC_HELP_STRING([--with-group=GROUP], + [group to access the player]), + [ac_cv_use_group=$withval], [ac_cv_use_group=root]) +AC_CACHE_CHECK([group to access the player], + [ac_cv_use_group], [ac_cv_use_group=root])]) + +TEST_GROUP +MPIOGROUP=$ac_cv_use_group +AC_SUBST(MPIOGROUP) + +dnl 3. permissions + +AC_DEFUN([TEST_PERM], +[AC_ARG_WITH([perm], + AC_HELP_STRING([--with-perm=PERM], + [permissions for accessing the player]), + [ac_cv_use_perm=$withval], [ac_cv_use_perm=0666]) +AC_CACHE_CHECK([permissions for accessing the player], + [ac_cv_use_perm], [ac_cv_use_perm=0666])]) + +TEST_PERM +MPIOPERM=$ac_cv_use_perm +AC_SUBST(MPIOPERM) + dnl --- only use deprecated kernel module if requested AC_DEFUN([TEST_KERNEL], @@ -158,6 +201,7 @@ if test -z ${KERNEL_INCLUDE}; then AC_ERROR(could not find directory of kernel include files) else AC_MSG_RESULT(Using kernel includes from ${KERNEL_INCLUDE}) + AC_DEFINE(USE_KMODULE,1,[Whether you want support for the deprecated kernel module]) fi AC_SUBST(KERNEL_INCLUDE) @@ -173,5 +217,7 @@ AC_OUTPUT( mpiosh/Makefile etc/Makefile tools/Makefile + hotplug/libmpio + hotplug/Makefile mpio.spec ) diff --git a/libmpio/defs.h b/libmpio/defs.h index 65201a0..780c46e 100644 --- a/libmpio/defs.h +++ b/libmpio/defs.h @@ -1,5 +1,5 @@ /* - * $Id: defs.h,v 1.32 2004/01/13 11:37:34 germeier Exp $ + * $Id: defs.h,v 1.33 2004/04/19 12:19:20 germeier Exp $ * * libmpio - a library for accessing Digit@lways MPIO players * Copyright (C) 2002, 2003 Markus Germeier @@ -32,9 +32,7 @@ extern "C" { #endif -#ifdef HAVE_USB #include "usb.h" -#endif typedef unsigned char BYTE; typedef unsigned short WORD; @@ -288,14 +286,12 @@ typedef struct { BYTE version[CMD_SIZE]; int fd; -#ifdef HAVE_USB int use_libusb; struct usb_bus *usb_busses; struct usb_bus *usb_bus; struct usb_dev_handle *usb_handle; int usb_out_ep; int usb_in_ep; -#endif BYTE *charset; /* charset used for filename conversion */ BYTE id3; /* enable/disable ID3 rewriting support */ diff --git a/libmpio/src/io.c b/libmpio/src/io.c index 8ff5ca9..2d0a029 100644 --- a/libmpio/src/io.c +++ b/libmpio/src/io.c @@ -1,8 +1,8 @@ /* - * $Id: io.c,v 1.9 2004/01/13 11:37:34 germeier Exp $ + * $Id: io.c,v 1.10 2004/04/19 12:19:26 germeier Exp $ * * libmpio - a library for accessing Digit@lways MPIO players - * Copyright (C) 2002, 2003 Markus Germeier + * Copyright (C) 2002-2004 Markus Germeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -157,7 +157,7 @@ blockaddress_decode(BYTE *entry) } if (p) { - debug("parity error found in block address: %2x\n", ba); + debug("error: parity error found in block address: %2x\n", ba); return MPIO_BLOCK_DEFECT; } @@ -187,7 +187,7 @@ fatentry2hw(mpio_fatentry_t *f, BYTE *chip, DWORD *address) sm = &f->m->external; *chip = MPIO_EXTERNAL_MEM; *address = mpio_zone_block_find_log(f->m, f->mem, f->entry); - debugn(3, "mager: %06x (logical: %04x)\n", *address, f->entry); + debugn(3, "%06x (logical: %04x)\n", *address, f->entry); } return; } @@ -410,7 +410,7 @@ mpio_zone_block_find_free_seq(mpio_t *m, mpio_cmd_t mem, DWORD lblock) if (value != MPIO_BLOCK_NOT_FOUND) { - debug("logical block numbers is already assigned! (%4x)\n", lblock); + debug("logical block numbers is already assigned! (lblock=0x%04x)\n", lblock); exit (-1); } @@ -433,7 +433,7 @@ mpio_zone_block_find_free_seq(mpio_t *m, mpio_cmd_t mem, DWORD lblock) return MPIO_BLOCK_NOT_FOUND; } - debugn(2, "set new sector in zonetable, [%d][%d] = %4x\n", zone, i, block); + debugn(2, "set new sector in zonetable, [%d][%d] = 0x%04x\n", zone, i, block); sm->zonetable[zone][i] = block; @@ -505,22 +505,23 @@ mpio_block_get_blocksize(mpio_t *m, mpio_mem_t mem) { */ int mpio_device_open(mpio_t *m){ -#ifdef HAVE_USB struct usb_device *dev; struct usb_interface_descriptor *interface; struct usb_endpoint_descriptor *ep; int ret, i; - m->use_libusb=0; -#endif + m->use_libusb=1; +#ifdef USE_KMODULE + debugn(2, "trying kernel module\n"); m->fd = open(MPIO_DEVICE, O_RDWR); if (m->fd > 0) { - debug ("using kernel module\n"); + debugn(2, "using kernel module\n"); + m->use_libusb=0; return MPIO_OK; } +#endif -#ifdef HAVE_USB - debug("trying libusb\n"); + debugn(2, "trying libusb\n"); usb_init(); usb_find_busses(); usb_find_devices(); @@ -535,7 +536,7 @@ mpio_device_open(mpio_t *m){ if (dev->descriptor.idVendor == 0x2735) { if ((dev->descriptor.idProduct != 0x01) && (dev->descriptor.idProduct != 0x71)) - debug("Found Product ID %02x, which is unknown. Proceeding anyway.\n", + debugn(2, "Found Product ID %02x, which is unknown. Proceeding anyway.\n", dev->descriptor.idProduct); m->usb_handle = usb_open(dev); if (m->usb_handle) { @@ -547,10 +548,10 @@ mpio_device_open(mpio_t *m){ if (ret < 0) { - debug ("Error claiming device: %d \"%s\"\n", ret, usb_strerror()); + debugn(2, "Error claiming device: %d \"%s\"\n", ret, usb_strerror()); return MPIO_ERR_PERMISSION_DENIED; } else { - debug ("claimed interface 0\n"); + debugn(2, "claimed interface 0\n"); } @@ -558,47 +559,47 @@ mpio_device_open(mpio_t *m){ for (i = 0 ; i < interface->bNumEndpoints; i++) { ep = &interface->endpoint[i]; - debug("USB endpoint #%d (Addr:%02x, Attr:%02x)\n", i, + debugn(2, "USB endpoint #%d (Addr=0x%02x, Attr=0x%02x)\n", i, ep->bEndpointAddress, ep->bmAttributes); if (ep->bmAttributes == 2) { if (ep->bEndpointAddress & USB_ENDPOINT_IN) { - debug("FOUND incoming USB endpoint (%02x)\n", ep->bEndpointAddress); + debugn(2, "FOUND incoming USB endpoint (0x%02x)\n", ep->bEndpointAddress); m->usb_in_ep = ep->bEndpointAddress & ~(USB_ENDPOINT_IN); } else { - debug("FOUND outgoing USB endpoint (%02x)\n", ep->bEndpointAddress); + debugn(2, "FOUND outgoing USB endpoint (0x%02x)\n", ep->bEndpointAddress); m->usb_out_ep = ep->bEndpointAddress; } } } if (!(m->usb_in_ep && m->usb_out_ep)) { - debug("Did not find USB bulk endpoints"); + debugn(2, "Did not find USB bulk endpoints.\n"); return MPIO_ERR_PERMISSION_DENIED; } - m->use_libusb=1; + debugn(2, "using libusb\n"); return MPIO_OK; - } } } } - -#endif + + m->use_libusb=0; return MPIO_ERR_PERMISSION_DENIED; } int mpio_device_close(mpio_t *m) { -#ifdef HAVE_USB if(m->use_libusb) { -#endif + usb_close(m->usb_handle); close(m->fd); m->fd=0; -#ifdef HAVE_USB - } - usb_close(m->usb_handle); - m->use_libusb = 0; + } +#ifdef USE_KMODULE + else { + close(m->fd); + m->fd=0; + } #endif return MPIO_OK; @@ -694,13 +695,16 @@ mpio_io_bulk_write(int fd, BYTE *block, int num_bytes) int mpio_io_write(mpio_t *m, BYTE *block, int num_bytes) { -#ifdef HAVE_USB if (m->use_libusb) { - return usb_bulk_write(m->usb_handle, m->usb_out_ep, block, num_bytes, MPIO_USB_TIMEOUT); - } else { -#endif + int r; + r = usb_bulk_write(m->usb_handle, m->usb_out_ep, block, num_bytes, MPIO_USB_TIMEOUT); + if (r < 0) + debug("libusb returned error: (%08x) \"%s\"\n", r, usb_strerror()); + return r; + } +#ifdef USE_KMODULE + else { return mpio_io_bulk_write(m->fd, block, num_bytes); -#ifdef HAVE_USB } #endif } @@ -744,17 +748,21 @@ mpio_io_bulk_read (int fd, BYTE *block, int num_bytes) int mpio_io_read (mpio_t *m, BYTE *block, int num_bytes) { -#ifdef HAVE_USB if (m->use_libusb) { - return usb_bulk_read(m->usb_handle, m->usb_in_ep, block, num_bytes, MPIO_USB_TIMEOUT); - } else { -#endif + int r; + r = usb_bulk_read(m->usb_handle, m->usb_in_ep, block, num_bytes, MPIO_USB_TIMEOUT); + if (r < 0) + debug("libusb returned error: (%08x) \"%s\"\n", r, usb_strerror()); + return r; + } +#ifdef USE_KMODULE + else { return mpio_io_bulk_read(m->fd, block, num_bytes); -#ifdef HAVE_USB } #endif } + /* * low level functions */ @@ -784,7 +792,7 @@ mpio_io_version_read(mpio_t *m, BYTE *buffer) if (nwrite != CMD_SIZE) { - debug ("Failed to send command.\n\n"); + debug ("Failed to send command.\n"); close (m->fd); return 0; } @@ -794,7 +802,7 @@ mpio_io_version_read(mpio_t *m, BYTE *buffer) if (nread == -1 || nread != 0x40) { - debug ("Failed to read Sector.\n%x\n",nread); + debug ("Failed to read Sector.(nread=0x%04x)\n",nread); close (m->fd); return 0; } @@ -854,7 +862,7 @@ mpio_io_sector_read(mpio_t *m, BYTE mem, DWORD index, BYTE *output) } } - debugn (2, "sector: %8x (%06x)\n", index, sector); + debugn (2, "sector: (index=0x%8x sector=0x%06x)\n", index, sector); mpio_io_set_cmdpacket (m, GET_SECTOR, mem, sector, sm->size, 0, cmdpacket); @@ -865,7 +873,7 @@ mpio_io_sector_read(mpio_t *m, BYTE mem, DWORD index, BYTE *output) if(nwrite != CMD_SIZE) { - debug ("\nFailed to send command.\n\n"); + debug ("\nFailed to send command.\n"); close (m->fd); return 1; } @@ -875,7 +883,7 @@ mpio_io_sector_read(mpio_t *m, BYTE mem, DWORD index, BYTE *output) if(nread != SECTOR_TRANS) { - debug ("\nFailed to read Sector.\n%x\n", nread); + debug ("\nFailed to read Sector.(nread=0x%04x)\n", nread); close (m->fd); return 1; } @@ -887,7 +895,7 @@ mpio_io_sector_read(mpio_t *m, BYTE mem, DWORD index, BYTE *output) (recvbuff + SECTOR_SIZE + 13)) || mpio_ecc_256_check ((recvbuff + (SECTOR_SIZE / 2)), (recvbuff + SECTOR_SIZE + 8)) ) - debug ("ECC error @ (%02x : %06x)\n", mem, index); + debug ("ECC error @ (mem=0x%02x index=0x%06x)\n", mem, index); } /* This should not be needed: @@ -986,7 +994,7 @@ mpio_io_sector_write(mpio_t *m, BYTE mem, DWORD index, BYTE *input) if (pvalue == MPIO_BLOCK_NOT_FOUND) { - debug ("Oops, this should never happen! (%6x : %6x)\n", + debug ("Oops, this should never happen! (index=0x%06x block_address=0x%06x)\n", index, block_address); exit (-1); } @@ -1004,7 +1012,7 @@ mpio_io_sector_write(mpio_t *m, BYTE mem, DWORD index, BYTE *input) if(nwrite != CMD_SIZE) { - debug ("\nFailed to send command.\n\n"); + debug ("\nFailed to send command.\n"); close (m->fd); return 1; } @@ -1057,7 +1065,7 @@ mpio_io_sector_write(mpio_t *m, BYTE mem, DWORD index, BYTE *input) if(nwrite != SECTOR_TRANS) { - debug ("\nFailed to read Sector.\n%x\n", nwrite); + debug ("\nFailed to write Sector.(nwrite=0x%04x)\n", nwrite); close (m->fd); return 1; } @@ -1095,7 +1103,7 @@ mpio_io_megablock_read(mpio_t *m, mpio_mem_t mem, mpio_fatentry_t *f, BYTE *outp if(nwrite != CMD_SIZE) { - debug ("\nFailed to send command.\n\n"); + debug ("\nFailed to send command.\n"); close (m->fd); return 1; } @@ -1107,7 +1115,7 @@ mpio_io_megablock_read(mpio_t *m, mpio_mem_t mem, mpio_fatentry_t *f, BYTE *outp if(nread != BLOCK_TRANS) { - debug ("\nFailed to read (sub-)block.\n%x\n",nread); + debug ("\nFailed to read (sub-)block.(nread=0x%04x)\n",nread); close (m->fd); return 1; } @@ -1155,7 +1163,7 @@ mpio_io_block_read(mpio_t *m, mpio_mem_t mem, mpio_fatentry_t *f, BYTE *output) if(nwrite != CMD_SIZE) { - debug ("\nFailed to send command.\n\n"); + debug ("\nFailed to send command.\n"); close (m->fd); return 1; } @@ -1165,7 +1173,7 @@ mpio_io_block_read(mpio_t *m, mpio_mem_t mem, mpio_fatentry_t *f, BYTE *output) if(nread != BLOCK_TRANS) { - debug ("\nFailed to read Block.\n%x\n",nread); + debug ("\nFailed to read Block.(nread=0x%04x)\n",nread); close (m->fd); return 1; } @@ -1184,7 +1192,7 @@ mpio_io_block_read(mpio_t *m, mpio_mem_t mem, mpio_fatentry_t *f, BYTE *output) + (SECTOR_SIZE / 2)), ((recvbuff +(i * SECTOR_TRANS) + SECTOR_SIZE + 8)))) - debug ("ECC error @ (%02x : %06x)\n", chip, address); + debug ("ECC error @ (chip=0x%02x address=0x%06x)\n", chip, address); } memcpy(output + (i * SECTOR_SIZE), @@ -1237,7 +1245,7 @@ mpio_io_spare_read(mpio_t *m, BYTE mem, DWORD index, WORD size, nwrite = mpio_io_write(m, cmdpacket, CMD_SIZE); if(nwrite != CMD_SIZE) { - debug ("\nFailed to send command.\n\n"); + debug ("\nFailed to send command.\n"); close (m->fd); return 1; } @@ -1257,7 +1265,7 @@ mpio_io_spare_read(mpio_t *m, BYTE mem, DWORD index, WORD size, if(nread != CMD_SIZE) { - debug ("\nFailed to read Block.\n%x\n",nread); + debug ("\nFailed to read Block.(nread=0x%04x)\n",nread); close (m->fd); return 1; } @@ -1286,7 +1294,7 @@ mpio_io_block_delete(mpio_t *m, mpio_mem_t mem, mpio_fatentry_t *f) if (address == MPIO_BLOCK_NOT_FOUND) { - debug("hmm, what happens here? (%4x)\n", f->entry); + debug("hmm, what happened here? (%4x)\n", f->entry); return 0; } @@ -1333,7 +1341,7 @@ mpio_io_block_delete_phys(mpio_t *m, BYTE chip, DWORD address) if (nwrite != CMD_SIZE) { - debug ("Failed to send command.\n\n"); + debug ("Failed to send command.\n"); close (m->fd); return 0; } @@ -1343,7 +1351,7 @@ mpio_io_block_delete_phys(mpio_t *m, BYTE chip, DWORD address) if ((nread == -1) || (nread != CMD_SIZE)) { - debug ("Failed to read Response.\n%x\n",nread); + debug ("Failed to read Response.(nread=0x%04x)\n",nread); close (m->fd); return 0; } @@ -1354,10 +1362,10 @@ mpio_io_block_delete_phys(mpio_t *m, BYTE chip, DWORD address) if (status[0] != CMD_OK) { if (status[0] == CMD_ERROR) { - debugn (0, "error formatting Block %02x:%06x\n", + debugn (0, "error formatting Block (chip=0x%02x address=0x%06x\n", chip, address); } else { - debugn (0,"UNKNOWN error (code: %02x) formatting Block %02x:%06x\n", + debugn (0,"UNKNOWN error (code: %02x) formatting Block (chip=0x%02x address=0x%06x)\n", status[0], chip, address); } @@ -1407,7 +1415,7 @@ mpio_io_megablock_write(mpio_t *m, mpio_mem_t mem, mpio_fatentry_t *f, BYTE *dat if(nwrite != CMD_SIZE) { - debug ("\nFailed to send command.\n\n"); + debug ("\nFailed to send command.\n"); close (m->fd); return 1; } @@ -1435,7 +1443,7 @@ mpio_io_megablock_write(mpio_t *m, mpio_mem_t mem, mpio_fatentry_t *f, BYTE *dat if(nwrite != MEGABLOCK_TRANS_WRITE) { - debug ("\nFailed to write block (%d).\n%x\n", i, nwrite); + debug ("\nFailed to write block (i=%d nwrite=0x%04x)\n", i, nwrite); close (m->fd); return 1; } @@ -1531,7 +1539,7 @@ mpio_io_block_write(mpio_t *m, mpio_mem_t mem, mpio_fatentry_t *f, BYTE *data) if(nwrite != CMD_SIZE) { - debug ("\nFailed to send command.\n\n"); + debug ("\nFailed to send command.\n"); close (m->fd); return 1; } @@ -1543,7 +1551,7 @@ mpio_io_block_write(mpio_t *m, mpio_mem_t mem, mpio_fatentry_t *f, BYTE *data) if(nwrite != BLOCK_TRANS) { - debug ("\nFailed to read Block.\n%x\n",nwrite); + debug ("\nFailed to read Block.(nwrite=0x%04x\n",nwrite); close (m->fd); return 1; } diff --git a/libmpio/src/mpio.c b/libmpio/src/mpio.c index 3e08617..6915ff1 100644 --- a/libmpio/src/mpio.c +++ b/libmpio/src/mpio.c @@ -1,8 +1,8 @@ /* - * $Id: mpio.c,v 1.11 2004/01/13 11:37:34 germeier Exp $ + * $Id: mpio.c,v 1.12 2004/04/19 12:19:26 germeier Exp $ * * libmpio - a library for accessing Digit@lways MPIO players - * Copyright (C) 2002, 2003 Markus Germeier + * Copyright (C) 2002-2004 Markus Germeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -234,14 +234,6 @@ mpio_init_internal(mpio_t *m) sm->cdir = sm->root; if (sm->version) { - printf("*******************************************\n"); - printf("This is a work-in-progress version, so BEWARE!\n"); - printf("The assumed status of this code is:\n"); - printf(" * reading: assumed working\n"); - printf(" * deleting: assumed working, needs further testing\n"); - printf(" * writing: assumed working, needs further testing\n"); - printf(" * formatting: assumed working, needs further testing\n"); - /* special features */ sm->recursive_directory=1; } else { diff --git a/libmpio/src/smartmedia.c b/libmpio/src/smartmedia.c index e037d84..ac3478a 100644 --- a/libmpio/src/smartmedia.c +++ b/libmpio/src/smartmedia.c @@ -1,8 +1,8 @@ /* - * $Id: smartmedia.c,v 1.8 2004/02/08 14:45:23 germeier Exp $ + * $Id: smartmedia.c,v 1.9 2004/04/19 12:19:26 germeier Exp $ * * libmpio - a library for accessing Digit@lways MPIO players - * Copyright (C) 2002, 2003 Markus Germeier + * Copyright (C) 2002-2004 Markus Germeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -80,7 +80,7 @@ mpio_id2mem(BYTE id) i=256; break; default: - debug("This should never happen! (id2mem)\n"); + debug("This should never happen! (id=0x%02x)\n", id); exit (1); } return i; @@ -93,16 +93,16 @@ mpio_id2manufacturer(BYTE id) switch(id) { case 0xec: - m="Samsung (Micronas)"; + m="Samsung"; break; case 0x98: m="Toshiba"; break; case 0x13: - m="Unknown"; + m="Unknown 0x13"; break; default: - m="unknown"; + m="Unknown"; } return m; } @@ -158,7 +158,7 @@ mpio_id2geo(BYTE id, mpio_disk_phy_t *geo) *geo = MPIO_DISK_GEO_256; break; default: - debug("This should never happen! (mpio_id2geo)\n"); + debug("This should never happen! (id=0x%02x)\n", id); exit (1); } diff --git a/mpio.spec.in b/mpio.spec.in index 842de6a..2c4aaa3 100644 --- a/mpio.spec.in +++ b/mpio.spec.in @@ -45,6 +45,9 @@ echo "%defattr(644,root,root)" >> /tmp/mpio-files.lst echo "%sysconfdir/mpio/mpioshrc" >> /tmp/mpio-files.lst echo "%prefix/include/mpio/mpio.h" >> /tmp/mpio-files.lst echo "%prefix/include/mpio/defs.h" >> /tmp/mpio-files.lst +echo "/etc/hotplug/usb/libmpio.usermap" >> /tmp/mpio-files.lst +echo "%defattr(755,root,root)" >> /tmp/mpio-files.lst +echo "/etc/hotplug/usb/libmpio" >> /tmp/mpio-files.lst make DESTDIR=$RPM_BUILD_ROOT install |