Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Typedefs | Functions
docecc.c File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include <asm/errno.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/doc2000.h>

Go to the source code of this file.

Macros

#define DEBUG_ECC   0
 
#define MM   10 /* Symbol size in bits */
 
#define KK   (1023-4) /* Number of data symbols per block */
 
#define B0   510 /* First root of generator polynomial, alpha form */
 
#define PRIM   1 /* power of alpha used to generate roots of generator poly */
 
#define NN   ((1 << MM) - 1)
 
#define A0   (NN)
 
#define CLEAR(a, n)
 
#define COPY(a, b, n)
 
#define COPYDOWN(a, b, n)
 
#define Ldec   1
 
#define SECTOR_SIZE   512
 
#define NB_DATA   (((SECTOR_SIZE + 1) * 8 + 6) / MM)
 

Typedefs

typedef unsigned short dtype
 
typedef int gf
 

Functions

int doc_decode_ecc (unsigned char sector[SECTOR_SIZE], unsigned char ecc1[6])
 
 EXPORT_SYMBOL_GPL (doc_decode_ecc)
 
 MODULE_LICENSE ("GPL")
 
 MODULE_AUTHOR ("Fabrice Bellard <[email protected]>")
 
 MODULE_DESCRIPTION ("ECC code for correcting errors detected by DiskOnChip 2000 and Millennium ECC hardware")
 

Macro Definition Documentation

#define A0   (NN)

Definition at line 64 of file docecc.c.

#define B0   510 /* First root of generator polynomial, alpha form */

Definition at line 43 of file docecc.c.

#define CLEAR (   a,
  n 
)
Value:
{\
int ci;\
for(ci=(n)-1;ci >=0;ci--)\
(a)[ci] = 0;\
}

Definition at line 79 of file docecc.c.

#define COPY (   a,
  b,
  n 
)
Value:
{\
int ci;\
for(ci=(n)-1;ci >=0;ci--)\
(a)[ci] = (b)[ci];\
}

Definition at line 85 of file docecc.c.

#define COPYDOWN (   a,
  b,
  n 
)
Value:
{\
int ci;\
for(ci=(n)-1;ci >=0;ci--)\
(a)[ci] = (b)[ci];\
}

Definition at line 91 of file docecc.c.

#define DEBUG_ECC   0

Definition at line 37 of file docecc.c.

#define KK   (1023-4) /* Number of data symbols per block */

Definition at line 42 of file docecc.c.

#define Ldec   1

Definition at line 97 of file docecc.c.

#define MM   10 /* Symbol size in bits */

Definition at line 41 of file docecc.c.

#define NB_DATA   (((SECTOR_SIZE + 1) * 8 + 6) / MM)

Definition at line 431 of file docecc.c.

#define NN   ((1 << MM) - 1)

Definition at line 45 of file docecc.c.

#define PRIM   1 /* power of alpha used to generate roots of generator poly */

Definition at line 44 of file docecc.c.

#define SECTOR_SIZE   512

Definition at line 429 of file docecc.c.

Typedef Documentation

typedef unsigned short dtype

Definition at line 47 of file docecc.c.

typedef int gf

Definition at line 59 of file docecc.c.

Function Documentation

int doc_decode_ecc ( unsigned char  sector[SECTOR_SIZE],
unsigned char  ecc1[6] 
)

Definition at line 439 of file docecc.c.

EXPORT_SYMBOL_GPL ( doc_decode_ecc  )
MODULE_AUTHOR ( "Fabrice Bellard <[email protected]>"  )
MODULE_DESCRIPTION ( "ECC code for correcting errors detected by DiskOnChip 2000 and Millennium ECC hardware )
MODULE_LICENSE ( "GPL"  )