Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
ms_mg.c File Reference
#include <linux/blkdev.h>
#include <linux/kthread.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include "debug.h"
#include "trace.h"
#include "rts51x.h"
#include "rts51x_transport.h"
#include "rts51x_scsi.h"
#include "rts51x_card.h"
#include "ms.h"

Go to the source code of this file.

Functions

int mg_set_tpc_para_sub (struct rts51x_chip *chip, int type, u8 mg_entry_num)
 
int mg_set_leaf_id (struct scsi_cmnd *srb, struct rts51x_chip *chip)
 
int mg_get_local_EKB (struct scsi_cmnd *srb, struct rts51x_chip *chip)
 
int mg_chg (struct scsi_cmnd *srb, struct rts51x_chip *chip)
 
int mg_get_rsp_chg (struct scsi_cmnd *srb, struct rts51x_chip *chip)
 
int mg_rsp (struct scsi_cmnd *srb, struct rts51x_chip *chip)
 
int mg_get_ICV (struct scsi_cmnd *srb, struct rts51x_chip *chip)
 
int mg_set_ICV (struct scsi_cmnd *srb, struct rts51x_chip *chip)
 

Function Documentation

int mg_chg ( struct scsi_cmnd srb,
struct rts51x_chip chip 
)

Send challenge(host) to medium.

After receiving this SCSI command, adapter shall sequentially issues TPC commands to the medium for writing 8-bytes data as challenge by host within a short data packet.

Definition at line 232 of file ms_mg.c.

int mg_get_ICV ( struct scsi_cmnd srb,
struct rts51x_chip chip 
)
  • Send ICV data to host.

After receiving this SCSI command, adapter shall read the divided data(1024 bytes totally) from medium by using READ_LONG_DATA TPC for 2 times, and report data to host with data-length is 1028 bytes.

Since the extra 4 bytes data is just only a prefix to original data that read from medium, so that the 4-byte data pushed into Ring buffer precedes data transmission from medium to Ring buffer by DMA mechanism in order to get maximum performance and minimum code size simultaneously.

Definition at line 450 of file ms_mg.c.

int mg_get_local_EKB ( struct scsi_cmnd srb,
struct rts51x_chip chip 
)

Send Local EKB to host.

After receiving this SCSI command, adapter shall read the divided data(1536 bytes totally) from medium by using READ_LONG_DATA TPC for 3 times, and report data to host with data-length is 1052 bytes.

Definition at line 173 of file ms_mg.c.

int mg_get_rsp_chg ( struct scsi_cmnd srb,
struct rts51x_chip chip 
)

Send Response and Challenge data to host.

After receiving this SCSI command, adapter shall communicates with the medium, get parameters(HRd, Rms, MagicGateID) by using READ_SHORT_DATA TPC and send the data to host according to certain format required by MG-R specification. The paremeter MagicGateID is the one that adapter has obtained from the medium by TPC commands in Set Leaf ID command phase previously.

Definition at line 323 of file ms_mg.c.

int mg_rsp ( struct scsi_cmnd srb,
struct rts51x_chip chip 
)

Send response(host) to medium.

After receiving this SCSI command, adapter shall sequentially issues TPC commands to the medium for writing 8-bytes data as challenge by host within a short data packet.

Definition at line 392 of file ms_mg.c.

int mg_set_ICV ( struct scsi_cmnd srb,
struct rts51x_chip chip 
)

Send ICV data to medium.

After receiving this SCSI command, adapter shall receive 1028 bytes and write the later 1024 bytes to medium by WRITE_LONG_DATA TPC consecutively.

Since the first 4-bytes data is just only a prefix to original data that sent by host, and it should be skipped by shifting DMA pointer before writing 1024 bytes to medium.

Definition at line 514 of file ms_mg.c.

int mg_set_leaf_id ( struct scsi_cmnd srb,
struct rts51x_chip chip 
)

Get MagciGate ID and set Leaf ID to medium.

After receiving this SCSI command, adapter shall fulfill 2 tasks below in order:

  1. send GET_ID TPC command to get MagicGate ID and hold it till Response&challenge CMD.
  2. send SET_ID TPC command to medium with Leaf ID released by host in this SCSI CMD.

Definition at line 122 of file ms_mg.c.

int mg_set_tpc_para_sub ( struct rts51x_chip chip,
int  type,
u8  mg_entry_num 
)

Definition at line 81 of file ms_mg.c.