Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 249415
b: refs/heads/master
c: d8aba9d
h: refs/heads/master
i:
  249413: bd7ed2c
  249411: 8cac61c
  249407: 40a763b
v: v3
  • Loading branch information
Randy Dunlap authored and Greg Kroah-Hartman committed May 10, 2011
1 parent b0ab233 commit 2503e91
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 58 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e5813f8449f7c6ef71346b21e30b92c84133fd0f
refs/heads/master: d8aba9d5d6c0d9809798967b9aac293690233b6d
3 changes: 0 additions & 3 deletions trunk/drivers/staging/keucr/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
#include "transport.h"
#include "init.h"

BYTE IsSSFDCCompliance;
BYTE IsXDCompliance;

/*
* ENE_InitMedia():
*/
Expand Down
10 changes: 5 additions & 5 deletions trunk/drivers/staging/keucr/init.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ extern DWORD MediaChange;
extern int Check_D_MediaFmt(struct us_data *);


BYTE MS_Init[] = {
static BYTE MS_Init[] = {
0x90, 0xF0, 0x15, 0xE0, 0xF5, 0x1C, 0x11, 0x2C,
0x90, 0xFF, 0x09, 0xE0, 0x30, 0xE1, 0x06, 0x90,
0xFF, 0x23, 0x74, 0x80, 0xF0, 0x90, 0xFF, 0x09,
Expand Down Expand Up @@ -262,7 +262,7 @@ BYTE MS_Init[] = {
0x4D, 0x53, 0x2D, 0x49, 0x6E, 0x69, 0x74, 0x20,
0x20, 0x20, 0x20, 0x31, 0x30, 0x30, 0x30, 0x30 };

BYTE MSP_Rdwr[] = {
static BYTE MSP_Rdwr[] = {
0x90, 0xF0, 0x10, 0xE0, 0x90, 0xEA, 0x46, 0xF0,
0xB4, 0x04, 0x03, 0x02, 0xE1, 0x1E, 0x90, 0xFF,
0x09, 0xE0, 0x30, 0xE1, 0x06, 0x90, 0xFF, 0x23,
Expand Down Expand Up @@ -520,7 +520,7 @@ BYTE MSP_Rdwr[] = {
0x4D, 0x53, 0x50, 0x2D, 0x52, 0x57, 0x20, 0x20,
0x20, 0x20, 0x20, 0x31, 0x30, 0x30, 0x30, 0x30 };

BYTE MS_Rdwr[] = {
static BYTE MS_Rdwr[] = {
0x90, 0xF0, 0x10, 0xE0, 0x90, 0xEA, 0x46, 0xF0,
0xB4, 0x02, 0x02, 0x80, 0x36, 0x90, 0xF0, 0x11,
0xE0, 0xF5, 0x17, 0x90, 0xF0, 0x12, 0xE0, 0xF5,
Expand Down Expand Up @@ -778,7 +778,7 @@ BYTE MS_Rdwr[] = {
0x4D, 0x53, 0x2D, 0x52, 0x57, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x31, 0x30, 0x30, 0x30, 0x30 };

BYTE SM_Init[] = {
static BYTE SM_Init[] = {
0x7B, 0x09, 0x7C, 0xF0, 0x7D, 0x10, 0x7E, 0xE9,
0x7F, 0xCC, 0x12, 0x2F, 0x71, 0x90, 0xE9, 0xCC,
0xE0, 0xB4, 0x07, 0x12, 0x90, 0xFF, 0x09, 0xE0,
Expand Down Expand Up @@ -1036,7 +1036,7 @@ BYTE SM_Init[] = {
0x58, 0x44, 0x2D, 0x49, 0x6E, 0x69, 0x74, 0x20,
0x20, 0x20, 0x20, 0x31, 0x30, 0x30, 0x30, 0x31 };

BYTE SM_Rdwr[] = {
static BYTE SM_Rdwr[] = {
0x7B, 0x0C, 0x7C, 0xF0, 0x7D, 0x10, 0x7E, 0xE9,
0x7F, 0xCC, 0x12, 0x2F, 0x71, 0x90, 0xE9, 0xC3,
0xE0, 0xB4, 0x73, 0x04, 0x74, 0x40, 0x80, 0x09,
Expand Down
14 changes: 14 additions & 0 deletions trunk/drivers/staging/keucr/smil.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,19 @@ struct CIS_AREA
};


extern BYTE IsSSFDCCompliance;
extern BYTE IsXDCompliance;

extern DWORD ErrXDCode;
extern DWORD ErrCode;
extern WORD ReadBlock;
extern WORD WriteBlock;
extern DWORD MediaChange;

extern struct SSFDCTYPE Ssfdc;
extern struct ADDRESS Media;
extern struct CIS_AREA CisArea;

//----- SMILMain.c ---------------------------------------------------
/******************************************/
int Init_D_SmartMedia (void);
Expand All @@ -223,6 +236,7 @@ int Media_D_OneSectWriteNext (struct us_data *,BYTE *);
int Media_D_OneSectWriteFlush (struct us_data *);

/******************************************/
extern int SM_FreeMem(void); /* ENE SM function */
void SM_EnableLED (struct us_data *,BOOLEAN);
void Led_D_TernOn (void);
void Led_D_TernOff (void);
Expand Down
49 changes: 25 additions & 24 deletions trunk/drivers/staging/keucr/smilecc.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,13 @@ static void trans_result (BYTE, BYTE, BYTE *, BYTE *);
#define MASK_CPS 0x3f
#define CORRECTABLE 0x00555554L

static void trans_result(reg2,reg3,ecc1,ecc2)
BYTE reg2; // LP14,LP12,LP10,...
BYTE reg3; // LP15,LP13,LP11,...
BYTE *ecc1; // LP15,LP14,LP13,...
BYTE *ecc2; // LP07,LP06,LP05,...
/*
* reg2; // LP14,LP12,LP10,...
* reg3; // LP15,LP13,LP11,...
* *ecc1; // LP15,LP14,LP13,...
* *ecc2; // LP07,LP06,LP05,...
*/
static void trans_result(BYTE reg2, BYTE reg3, BYTE *ecc1, BYTE *ecc2)
{
BYTE a; // Working for reg2,reg3
BYTE b; // Working for ecc1,ecc2
Expand Down Expand Up @@ -83,12 +85,14 @@ BYTE *ecc2; // LP07,LP06,LP05,...
}

//static void calculate_ecc(table,data,ecc1,ecc2,ecc3)
void calculate_ecc(table,data,ecc1,ecc2,ecc3)
BYTE *table; // CP0-CP5 code table
BYTE *data; // DATA
BYTE *ecc1; // LP15,LP14,LP13,...
BYTE *ecc2; // LP07,LP06,LP05,...
BYTE *ecc3; // CP5,CP4,CP3,...,"1","1"
/*
* *table; // CP0-CP5 code table
* *data; // DATA
* *ecc1; // LP15,LP14,LP13,...
* *ecc2; // LP07,LP06,LP05,...
* *ecc3; // CP5,CP4,CP3,...,"1","1"
*/
void calculate_ecc(BYTE *table, BYTE *data, BYTE *ecc1, BYTE *ecc2, BYTE *ecc3)
{
DWORD i; // For counting
BYTE a; // Working for table
Expand All @@ -113,12 +117,14 @@ BYTE *ecc3; // CP5,CP4,CP3,...,"1","1"
*ecc3=((~reg1)<<2)|BIT1BIT0; // Make TEL format
}

BYTE correct_data(data,eccdata,ecc1,ecc2,ecc3)
BYTE *data; // DATA
BYTE *eccdata; // ECC DATA
BYTE ecc1; // LP15,LP14,LP13,...
BYTE ecc2; // LP07,LP06,LP05,...
BYTE ecc3; // CP5,CP4,CP3,...,"1","1"
/*
* *data; // DATA
* *eccdata; // ECC DATA
* ecc1; // LP15,LP14,LP13,...
* ecc2; // LP07,LP06,LP05,...
* ecc3; // CP5,CP4,CP3,...,"1","1"
*/
BYTE correct_data(BYTE *data, BYTE *eccdata, BYTE ecc1, BYTE ecc2, BYTE ecc3)
{
DWORD l; // Working to check d
DWORD d; // Result of comparison
Expand Down Expand Up @@ -177,10 +183,7 @@ BYTE ecc3; // CP5,CP4,CP3,...,"1","1"
return(3); // Uncorrectable error
}

int _Correct_D_SwECC(buf,redundant_ecc,calculate_ecc)
BYTE *buf;
BYTE *redundant_ecc;
BYTE *calculate_ecc;
int _Correct_D_SwECC(BYTE *buf, BYTE *redundant_ecc, BYTE *calculate_ecc)
{
DWORD err;

Expand All @@ -195,9 +198,7 @@ BYTE *calculate_ecc;
return -1;
}

void _Calculate_D_SwECC(buf,ecc)
BYTE *buf;
BYTE *ecc;
void _Calculate_D_SwECC(BYTE *buf, BYTE *ecc)
{
calculate_ecc(ecctable,buf,ecc+1,ecc+0,ecc+2);
}
Expand Down
24 changes: 10 additions & 14 deletions trunk/drivers/staging/keucr/smilmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,31 +48,27 @@ int MarkFail_D_PhyOneBlock (struct us_data *);
DWORD ErrXDCode;
DWORD ErrCode;
//BYTE SectBuf[SECTSIZE];
BYTE WorkBuf[SECTSIZE];
BYTE Redundant[REDTSIZE];
BYTE WorkRedund[REDTSIZE];
static BYTE WorkBuf[SECTSIZE];
static BYTE Redundant[REDTSIZE];
static BYTE WorkRedund[REDTSIZE];
//WORD Log2Phy[MAX_ZONENUM][MAX_LOGBLOCK];
WORD *Log2Phy[MAX_ZONENUM]; // 128 x 1000, Log2Phy[MAX_ZONENUM][MAX_LOGBLOCK];
BYTE Assign[MAX_ZONENUM][MAX_BLOCKNUM/8];
WORD AssignStart[MAX_ZONENUM];
static WORD *Log2Phy[MAX_ZONENUM]; // 128 x 1000, Log2Phy[MAX_ZONENUM][MAX_LOGBLOCK];
static BYTE Assign[MAX_ZONENUM][MAX_BLOCKNUM/8];
static WORD AssignStart[MAX_ZONENUM];
WORD ReadBlock;
WORD WriteBlock;
DWORD MediaChange;
DWORD SectCopyMode;

extern struct SSFDCTYPE Ssfdc;
extern struct ADDRESS Media;
extern struct CIS_AREA CisArea;
static DWORD SectCopyMode;

//BIT Control Macro
BYTE BitData[] = { 0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80 } ;
static BYTE BitData[] = { 0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80 } ;
#define Set_D_Bit(a,b) (a[(BYTE)((b)/8)]|= BitData[(b)%8])
#define Clr_D_Bit(a,b) (a[(BYTE)((b)/8)]&=~BitData[(b)%8])
#define Chk_D_Bit(a,b) (a[(BYTE)((b)/8)] & BitData[(b)%8])

//extern PBYTE SMHostAddr;
extern BYTE IsSSFDCCompliance;
extern BYTE IsXDCompliance;
BYTE IsSSFDCCompliance;
BYTE IsXDCompliance;


//
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/staging/keucr/smilsub.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,8 @@ struct SSFDCTYPE Ssfdc;
struct ADDRESS Media;
struct CIS_AREA CisArea;

BYTE EccBuf[6];
static BYTE EccBuf[6];
extern PBYTE SMHostAddr;
extern BYTE IsSSFDCCompliance;
extern BYTE IsXDCompliance;
extern DWORD ErrXDCode;

extern WORD ReadBlock;
Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/staging/keucr/smscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ int SM_SCSI_Read_Capacity (struct us_data *us, struct scsi_cmnd *srb);
int SM_SCSI_Read (struct us_data *us, struct scsi_cmnd *srb);
int SM_SCSI_Write (struct us_data *us, struct scsi_cmnd *srb);

extern struct SSFDCTYPE Ssfdc;
extern struct ADDRESS Media;
extern PBYTE SMHostAddr;
extern DWORD ErrXDCode;

Expand Down
3 changes: 0 additions & 3 deletions trunk/drivers/staging/keucr/transport.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,4 @@ extern int MS_CountFreeBlock(struct us_data *us, WORD PhyBlock);
extern int MS_LibSearchBlockFromLogical(struct us_data *us, WORD logblk);
extern int MS_LibSearchBlockFromPhysical(struct us_data *us, WORD phyblk);

// ENE SM function
extern int SM_FreeMem(void);

#endif
7 changes: 4 additions & 3 deletions trunk/drivers/staging/keucr/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include "usb.h"
#include "scsiglue.h"
#include "smil.h"
#include "transport.h"

/* Some informational data */
Expand All @@ -34,7 +35,7 @@ MODULE_DEVICE_TABLE (usb, eucr_usb_ids);

#ifdef CONFIG_PM

int eucr_suspend(struct usb_interface *iface, pm_message_t message)
static int eucr_suspend(struct usb_interface *iface, pm_message_t message)
{
struct us_data *us = usb_get_intfdata(iface);
pr_info("--- eucr_suspend ---\n");
Expand All @@ -55,7 +56,7 @@ int eucr_suspend(struct usb_interface *iface, pm_message_t message)
}
//EXPORT_SYMBOL_GPL(eucr_suspend);

int eucr_resume(struct usb_interface *iface)
static int eucr_resume(struct usb_interface *iface)
{
BYTE tmp = 0;

Expand All @@ -80,7 +81,7 @@ int eucr_resume(struct usb_interface *iface)
return 0;
}
//EXPORT_SYMBOL_GPL(eucr_resume);
int eucr_reset_resume(struct usb_interface *iface)
static int eucr_reset_resume(struct usb_interface *iface)
{
BYTE tmp = 0;
struct us_data *us = usb_get_intfdata(iface);
Expand Down

0 comments on commit 2503e91

Please sign in to comment.