• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/mtools-4.0.10/

Lines Matching refs:Stream

71 static FatMap_t *GetFatMap(Fs_t *Stream)
76 Stream->fat_error = 0;
77 nr_entries = (Stream->fat_len + SECT_PER_ENTRY - 1) / SECT_PER_ENTRY;
91 static __inline__ int locate(Fs_t *Stream, size_t offset, int *slot, int *bit)
93 if(offset >= Stream->fat_len)
230 static unsigned char *getAddress(Fs_t *Stream,
237 sector = num >> Stream->sectorShift;
239 if(sector == Stream->lastFatSectorNr &&
240 Stream->lastFatAccessMode >= mode)
241 ret = Stream->lastFatSectorData;
243 ret = loadSector(Stream, sector, mode, 0);
246 Stream->lastFatSectorNr = sector;
247 Stream->lastFatSectorData = ret;
248 Stream->lastFatAccessMode = mode;
250 offset = num & Stream->sectorMask;
255 static int readByte(Fs_t *Stream, int start)
259 address = getAddress(Stream, start, FAT_ACCESS_READ);
284 static unsigned int fat12_decode(Fs_t *Stream, unsigned int num)
287 int byte0 = readByte(Stream, start);
288 int byte1 = readByte(Stream, start+1);
290 if (num < 2 || byte0 < 0 || byte1 < 0 || num > Stream->num_clus+1) {
306 static void fat12_encode(Fs_t *Stream, unsigned int num, unsigned int code)
309 unsigned char *address0 = getAddress(Stream, start, FAT_ACCESS_WRITE);
310 unsigned char *address1 = getAddress(Stream, start+1, FAT_ACCESS_WRITE);
332 static unsigned int fat16_decode(Fs_t *Stream, unsigned int num)
334 unsigned char *address = getAddress(Stream, num << 1, FAT_ACCESS_READ);
340 static void fat16_encode(Fs_t *Stream, unsigned int num, unsigned int code)
342 unsigned char *address = getAddress(Stream, num << 1, FAT_ACCESS_WRITE);
347 static unsigned int fast_fat16_decode(Fs_t *Stream, unsigned int num)
350 (unsigned short *) getAddress(Stream, num << 1,
357 static void fast_fat16_encode(Fs_t *Stream, unsigned int num, unsigned int code)
360 (unsigned short *) getAddress(Stream, num << 1,
374 static unsigned int fat32_decode(Fs_t *Stream, unsigned int num)
376 unsigned char *address = getAddress(Stream, num << 2, FAT_ACCESS_READ);
382 static void fat32_encode(Fs_t *Stream, unsigned int num, unsigned int code)
384 unsigned char *address = getAddress(Stream, num << 2, FAT_ACCESS_WRITE);
389 static unsigned int fast_fat32_decode(Fs_t *Stream, unsigned int num)
392 (unsigned int *) getAddress(Stream, num << 2,
399 static void fast_fat32_encode(Fs_t *Stream, unsigned int num, unsigned int code)
402 (unsigned int *) getAddress(Stream, num << 2,
487 int zero_fat(Fs_t *Stream, int media_descriptor)
493 buf = malloc(Stream->sector_size);
498 for(i=0; i< Stream->num_fat; i++) {
499 fat_start = Stream->fat_start + i*Stream->fat_len;
500 for(j = 0; j < Stream->fat_len; j++) {
502 memset(buf, 0, Stream->sector_size);
506 if(Stream->fat_bits > 12)
508 if(Stream->fat_bits > 16) {
516 if(forceWriteSector(Stream, (char *)buf,
518 (signed int) Stream->sector_size) {
528 Stream->FatMap = GetFatMap(Stream);
529 if (Stream->FatMap == NULL) {
848 Stream_t *Stream = GetFs(Dir);
859 Stream_t *Stream = GetFs(Dir);
875 Stream_t *Stream = GetFs(Dir);
903 Stream_t *Stream = GetFs(Dir);
909 getfree(Stream);
962 Stream_t *Stream = GetFs(Dir);
975 Stream_t *Stream = GetFs(Dir);
979 if(fat32RootCluster(Stream))
984 int fs_free(Stream_t *Stream)