ftape-bsm.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef _FTAPE_BSM_H
  2. #define _FTAPE_BSM_H
  3. /*
  4. * Copyright (C) 1994-1996 Bas Laarhoven,
  5. * (C) 1996-1997 Claus-Justus Heine.
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2, or (at your option)
  9. any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; see the file COPYING. If not, write to
  16. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  17. *
  18. * $Source: /homes/cvs/ftape-stacked/ftape/lowlevel/ftape-bsm.h,v $
  19. * $Revision: 1.2 $
  20. * $Date: 1997/10/05 19:18:07 $
  21. *
  22. * This file contains definitions for the bad sector map handling
  23. * routines for the QIC-117 floppy-tape driver for Linux.
  24. */
  25. #include <linux/ftape.h>
  26. #include <linux/ftape-header-segment.h>
  27. #define EMPTY_SEGMENT (0xffffffff)
  28. #define FAKE_SEGMENT (0xfffffffe)
  29. /* maximum (format code 4) bad sector map size (bytes).
  30. */
  31. #define BAD_SECTOR_MAP_SIZE (29 * SECTOR_SIZE - 256)
  32. /* format code 4 bad sector entry, ftape uses this
  33. * internally for all format codes
  34. */
  35. typedef __u32 SectorMap;
  36. /* variable and 1100 ft bad sector map entry. These three bytes represent
  37. * a single sector address measured from BOT.
  38. */
  39. typedef struct NewSectorMap {
  40. __u8 bytes[3];
  41. } SectorCount;
  42. /*
  43. * ftape-bsm.c defined global vars.
  44. */
  45. /*
  46. * ftape-bsm.c defined global functions.
  47. */
  48. extern void update_bad_sector_map(__u8 * buffer);
  49. extern void ftape_extract_bad_sector_map(__u8 * buffer);
  50. extern SectorMap ftape_get_bad_sector_entry(int segment_id);
  51. extern __u8 *ftape_find_end_of_bsm_list(__u8 * address);
  52. extern void ftape_init_bsm(void);
  53. #endif